Save Changes Button resets (refreshes) table before running the trigger

After making changes to the table data, I click the Save Changes button. I have a trigger set up to save the changes. The first thing I see happen is that the table data resets to the original data. Then it appears the trigger runs, but I see the following message appear at the top of the screen:

{"status":422,"message":"An empty list of updates were applied.","statusCode":422,"error":"Unprocessable Entity","data":null,"queryExecutionMetadata":{"estimatedResponseSizeBytes":112,"resourceTimeTakenMs":2,"isPreview":false,"resourceType":"mssql...

I am suspecting that the table is reset before the trigger runs. If I just run the trigger manually, the changes are saved.

I have looked through the table setup, but I can't seem to find any place where I am requesting the table be reset.

Any ideas?

@trwald

Hey there, thanks for reaching out :wave: Would you mind sharing screenshots of the save changes event handler and the update query?

I am getting the same problem as trwald. Can you post the solution ?

Hey there @teeleh :wave: Happy to help! Would you mind sharing screenshots of your save changes event handler and update query?

Its very simple: the save trigger calls the SAVE_CHECKS query which is nothing more than the BULK UPDATE VIA A PRIMARY key and passing in {{table.recordUpdates}} that's all. When I press save the table shows (in a blink of an eye) the non-edited version and then refreshes to show the edit version again.

@teeleh

Got it! Is this a Postgres resource? Are you able to update this resource successfully when hardcoding values?

Can I also ask what event you currently have set for this event handler:

Please contact me privately, I don't want to post all this info on the forum with screenprints and the like. It is a SQL Server connection.

Hey @teeleh :wave: Definitely in support of you sharing it privately :slight_smile: Please email us at support@retool.com or start a chat with support:

Talk soon!

Hey @lauren.gus , Good to connect. Well, I'm stuck in an error and kinda similar to this topic. Hope I could use your help. Kindly let know how can we sort this please!! Thank you!

Hey @JayVeni! Stepping in here for Lauren to try getting you moving :slightly_smiling_face: Do you have the exact same issue (table record updates is clearing before the query runs) or something else?