Hi, Im having issues while running a loop with spreadsheet append from a table.
Theres a fileButton defined to load a csv into a table. A button triggers a query that iterates through the table data and augment the data coming from the current row and triggers spreadsheet append query as additionalScope param.
On the spreadsheet query onSuccess handler, the current row should get updated with the augmented data.
This query1 is the loop that augment, trigger spreadsheet query and finally update table
If you want to update and insert rows at the same time you'll need to use a combination of the "Update spreadsheet" and "Append data to a spreadsheet" actions (more on that here). Otherwise, if the rows just need to be updated you can stick with "Update spreadsheet"
For the second problem, can you try accumulating the data before passing it to the table? A pattern like the one described here may help. Instead of setting the table data on success, you can try adding the value to some aggregator and then setting your table:
The fileButton component will load a csv to the table. Each row will be processed and each result being success or fail will be will be appended on an audit spreadsheet.
Following your template on awaiting all promises to update table did work, now all rows on table1 are updated with no data loss.
However still experiencing data loss on spreadsheet row appending. As I show with screenshots, Im loading a 12 rows table but Im getting a 5 row spreadsheet.
It looks like this might be because you're making several simultaneous requests to the Google Sheets API at once. Can you try uploading them all together instead? The append data action supports arrays of objects as well, so you can try something like: