Trouble Capturing Edited Cell Value for Database Update in Retool Table

Hello Retool Community,

I am a newbie and I am experiencing an issue with updating a status column in my database from a Retool table UI. The column is an ENUM type in the database, and I want to reflect the changes made by a user in the UI immediately in the database when they click "Save."

Here’s the process I’m following:

  1. User edits the status in a table cell.
  2. The edited value is supposed to be captured in a variable.
  3. On clicking "Save," an update query should run to save this new status in the database.

However, I’m running into an issue where the variable is not capturing the edited value, but instead is holding onto the original value from the database.

I've set up an event handler for the table as follows:

  • Event: Change cell
  • Action: Set variable
  • State: (variable to hold the new status)
  • Value: {{ table1.selectedRow.status }}

Unfortunately, this setup seems to capture the original value from the database, not the edited one. I'm not sure if this is the right approach. I appreciate it if you can guide me. Thanks!



Hi @Mohammad_Nazari Thanks for reaching out & welcome to Retool!

The pending edited values are stored under the .changesetArray property and not under the .selectedRow property

It's helpful to ensure that your table has a primary key established, so that this shows in the changeset
image