Goal: In a table, I have a list of actions for each row. The list values differ in each row. Ideally I would like to have a list of buttons that I can click.
Steps: Since Retool doesn't support list of buttons for each row in a table, I add a Tag column in a table. The tag values are built when the row is selected. So the dropdown list of this column has a list of names of the actions for this particular row. I plan to have a change value trigger for this Tag column to perform the action. However, when the trigger is fired, I can not get the value of what's selected in the Tag column. In fact the value of this column seems to be undefined. I suspect this is because this column is not backed by the data of the table. Is there any way to solve this?
When you say a list of buttons, would the Row Actions work? If the list of actions is different for each row (but determined by each row's backend data values) you could create all of the actions and then set up the conditions that would hide them from the current row:
Otherwise, you are correct in assuming that the value is not available because it actually isn't in the source data. One way around this limitation is to create a state/variable which is loaded with your source data and then you have to update that variable with the changes as you go. It can be a little more tedious to handle updates this way using the table component so you might consider switching designs to incorporate something with better component control like a List View. It should be able to use the same source data as the table.
Basically, the variable/state is set by a success handler when the query is complete, the variable/state is then used as the data source instead of the query results:
This lets you modify the values as needed without committing back to the original source... but it can be a little bit of work to handle the updates. Without re-writing the changes somewhere, you could look into accessing the table's changesetArray which can help drive some of the logic since you'll always be making some sort of change to the row requiring actions.