Check rows in a Retool table, update a database tablerft

Hi @Michael_Stabosz, the bulk update should be straight forward. Here is an implementation:

A table with multiple row selection just like yours, and a Select component to set the desired role for the selected rows:

I added a button to submit the update in order to prevent running multiple queries if there's an error on selection, but feel free to skip it. When users click that button (or on dropdown selection if you prefer), we run this JS:

We are returning an array of objects with the id of each row, and the new role for the update. On success, we run the bulk update query (more on this query on the next step).

The bulk update query, uses the id of each object in the array to know which row to update, and updates the role column with the new value from the Select component:

Because this query runs on success, updateRoles.data will always be the updated objects. Finally, we attach two Success event handlers to this last query, one to refresh the table, and one to clear the selection.

Let us know if you have any questions! :slightly_smiling_face: