Triggering different queries depending on the dropdown value and adding the queries data to a single table

I have a drop down with 3 different values and a textbox with a button. The button will trigger a query based on the value selected from the dropdown. Say value1 will trigger query1, value2 selection will trigger query 2 after clicking the button. Also, i wanted to add this results to the table in retool which takes the values as per the selected execution from the dropdown values. The query1 and query2 are the snowflake queries. Can anyone explain how can we do this

@Jyothi You can set the button run the all the queries, but you can set it to run dependent on the value in the select dropdown.

In the event handler there is an option "Only run when" and you can set it to run only if the corresponding value in the select component is picked. Also you can filter the query based on the value in the select component so you only get relevant results filtered.


Hope this helps