Queries with parameters

I have 5 buttons that trigger the same query, and I want to do different things based on which button was clicked

5 Likes

break me out

+1

You could make the button trigger a JavaScript query and then trigger the SQL queries (or different queries) w/different parameters like this: https://docs.retool.com/docs/scripting-retool

Specifically, you would use triggeredById inside a JS query. That will give you the name of the component that triggered the query.

@coleca's solution seems great, it'd just be nice if this was natively supported from the UI so there could be autosuggestions.

1 Like

+1
Would be really great, so you can make more generelt and reusable scripts

+1 on this