Retool state engine is confusing

I just wasted a good few hours on trying to get the Retool state to work. I have an editable table that I need to process and save the values after the change inside another object. So I am not updating a database, I’m just updating a variable.

To do this, in the save action for the table I access the changeSetObject. Here is the crazy thing. In the state view the changesetObject is visible but if I use it in the script it is null.

console.log(mytable.changesetObject); shows as undefined even though mytable.changesetObject clearly shows up with content in the state viewer.

My fix is quite fugly but it works and I don’t understand why. Is there no better way.

const chob = JSON.parse(JSON.stringify(mytable.changesetObject));

Now chob is a change object that I can work with. Anything else yielded undefined.

Hi @Chris_Laurie,

Can you share a screen recording of the Javascript query that runs the console log not displaying table1.changesetObject ?

Or share the save script not showing it either? Are you self hosted or is your org on our cloud?