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.
Just wanted to circle back on this, the changesetObject should be accessible to use in scripts to use if you want to update the value of a variable using .setValue(), I am wondering if the linter might be previewing the changeset as null
The one thing would be if you are looking for changes when there have not been any made yet.
Let me know if you were able to test out what I shared in the Loom video. I would love to check out your app in office hours as well to see what could be causing the table's state to return null.