I have a retool table showing data as a result of Postgres query to supabase table, in that table I have a column of subject and a column of Action, in action column there are buttons to view threads which basically opens a slider and loads some data for which I have written another query.
Now I want a functionality that when button of any specific row is clicked it will call the query with respective row’s subject as body to the query and then returns its response.
Hi there @Burhan_Saqib and welcome to the forum!
Within your second query you can make reference to {{ table1.selectedSourceRow.subject }}
and make sure that your "Run Behavior" settings within the query are set to automatic so that every time your variable changes (i.e. a different row is selected) it triggers:
I made an introduction to tables where I show you can apply this functionality here:
Hi @Burhan_Saqib! I think @MiguelOrtiz is putting you on the right track here.
Clicking a button will put put that particular row into focus, meaning the information within becomes accessible through {{ table1.selectedSourceRow }}
and can be easily referenced from within the definition of your query. You can then choose whether to have your query execute automatically whenever the selected row changes or to trigger it manually using an event handler on your buttons.
I hope that helps! Let us know if you have any follow-up questions.