Updating Large Tables using Temporary State and JS

Hello, I'm trying to build a tool that would sync data from Spreadsheet and Firestore.

It seems that I stuck at the moment when I try to update the Temporary State variable.

Here is what I do:

  1. I get a table from Google Spreadsheets and ... save it in Temporary State and send it to Table component.
  2. After selecting certain raws - I modify them and save to Firestore.
    Up to this point everything is great.

Now I want to update modified values using Firestore IDs, and something doesn't work..

I assume that I can't use in JS something like that:
temp_state.value.[index].fieldvalue = newValue?
And I need to use .SetValue(value) method?

However, I have a large Array of Objects (about 15k), and I'm getting 501 error when I run the script.

Is there a way to update only a few objects instead of an entire array?

BTW, can anyone also help, how do I properly debug the JS, since consol.log doesn't print anything?

@Aquired_team Welcome to the forum!
Can you share more information about the temp state structure?
Some screenshots step by step would help as well to explain what you are trying to achieve...

As for console.log(); it works for me. (You may have left off the e)

1 Like

Hi @ScottR, thank you for replying.

I think I found another way of working with table, I still used a temporary state, and to store data from the query, than modify it, and send back to Google Spreadsheet. I wouldn't call it an optimal solution, but it worked.

Regarding console.log. Just tested it.... and it worked… Maybe there was some patch or something. I tried it so many times, and it didn't work then.

Thank you.