I have several buttons in my app. Such as Add Alias, Add Group, and more...
I have a log table in retool database.
I want to write a SINGLE insert query that records that current_user has clicked on this button or that button. In insert I want to grab the button component name dynamically and not create a different js query for each button.
is there a {{ something }} I can use to fetch what component was clicked?
to better clarify.
a simple app that has 3 buttons. button1, button2, and button3
i want to display a message "button1 clicked" if button1 was clicked.
i want to display a message "button2clicked" if button2 was clicked.
i want to display a message "button3 clicked" if button3 was clicked.
I can write 3 js for this. But, I rather write 1 single js that some how figures out the which button was clicked and appropriately messages the user.
Of course my js is bit more involved but what I need is the component name clicked value.
hope this helps.
Hello!
I believe you can use a single JS Query to process this in the following way:
- On any button that would trigger this query, you would need to set the Event Handler to run a script that triggers a query with additional scope.
- That query will use the additional scope value (the component's id) as you need act accordingly
Here is an example:
Returns:
self.id that is what I was looking for. Thank you