Tracking and Saving Indexed Row Edits from Retool Table to JSON Object

Goal: I'm trying to ensure that edits made to table rows in a Retool app correctly reflect in the original JSON array that's displayed in the app. The expected behavior is that when a user modifies a table row, the change should map to the correct index in the JSON array, despite the changeset array index not aligning with the JSON array's index.

Steps: In Table 1, I am pulling a column that contains the following JSON:

Then, I map this to a Table 2 to make it more readable (since there can be many products, and the JSON format is not user-friendly) where it would appear as:

I need to easily change the values of Table 2 (when needed) and keep it stored, updated and in the correct positions in a JSON format.

I'd like to be able to edit any of the values in Table 2 and save these changes to BigQuery. Tried many approaches, table2.changesetArray does not identify (or keep track) from which index I am pulling. I've tried using table2.selectedDataIndex , but if I edit more than one product in my Table 2, it becomes ineffective. I need an approach in Retool that recognizes the positions as well as the key-value pair from my Table 2, in case there is a change, to identify where the change occurred so them I can persist the formatted JSON in my BigQuery table in the order they appear in Table 2.

HI there @Rafael_Melhem,

welcome to the forum! I may be oversimplifying (or misunderstanding what you're trying to do) here, but could you add a hidden column with mapped value {{i}} and use it as your primary key so that it shows when using table2.changesetArray?