I just started learning retool. I was going through the tutorial (Retool apps tutorial: Interact with data) and it seems the changesetObject is no longer working as expected.
I was using last weekend and the following code snippet worked fine
{{table1.changesetObject['0'].id}}
However, now it is throwing up an error
TypeError: Cannot read properties of null (reading '0')
Did something change with changsetObject's implementation over the weekend?
Welcome to the Retool community. Nothing changed with changesetObject's behavior over the weekend, but it will be null when no edits are present in the Table (which would be the case on a fresh page load). Are you seeing this error in the Debug Tools Console?
You can work around this by using optional chaining and nullish coalescing in JavaScript to provide a default value like so:
{{ table1.changesetObject?.['0'].id ?? '' }}
If you're still seeing this error after editing a cell in the id column, let me know!
I suppose the documentation is outdated. In any case, do you have suggestions on how to extract the row ID from the changesetObject so that I can send a patch query?