Bulk update a spreadsheet by primary key not working

I am trying to bulk update a google sheet based of displayed values in a table, but I'm getting a never ending query.

I have set up the query and I have triggered it via a button. I've made sure all primary keys match. I am able to get the data from the spreadsheet no problem, but whenever I try to update it the query just keeps running endlessly and nothing happens in the spreadsheet.

I have tried appending values as well and it doesn't work.

Here is the setup:

Here you can see the console log from the script:
Google Chrome - Sales (PRODUCTION)  Editor  Retool - 2024-02-23 at 18.32.47

One thing to note also is that the query run never appears under the "running" tab of queries in the console.

HI @Nic_Byron,

A lot going on in there, and I'm not familiar with using Google Sheets as a DB, but for starters, can you try changing line 13 in your event handler script to the following:

   additionalScope: { 
     rowsToUpdate: tableDataArray 

If that doesn't work, can you expand a couple of the objects in that last screenshot to see what the data looks like?\

Also ensure the sheet is the first one in the doc, otherwise name it in the Sheet name field.

Thank you @MikeCB. I was missing the additionalScope :man_facepalming:t3:

1 Like