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.
