Google sheet delete multiple

Better way to lookup and delete multiple raws from sheet?

Hey @maxbaluev!

Just to make sure, I understand it correctly, you want to lookup for specific values and then delete them from the spreadsheet, right?

Also, are you using the Google Sheets node or the Spreadsheet File node?

It’s a google sheet. The number of lines to delete is large - I’m afraid to run into limits if I delete one line at a time. What is the best way to delete if the lines are not one after the other, but scattered throughout the document?

I am afraid it is not possible to use the Google Sheets node directly do this. Pinging @RicardoE105 here. He might have a solution.

You can try setup Cron run delete by seconds?

Yes, thank you, that’s the solution I’m using at the moment.

@maxbaluev I guess you can first do the look-up to retrieve all the rows you want to delete and then use the split batches node with a small wait not to hit the rate limit when deleting all that items. It should look similar to the image below:

1 Like

Could you share the code of this workflow?

After each delete, the order of the row changes causing a problem with the next loop. How can you go around it? or is there any other way to selectively delete multiple rows?

you can do it in this way if you are using google sheet.

  1. find the rows you want to delete.
  2. use a merge node in this way :
  • all the data as input 1
  • row you want to delete as input 2
    keep non matches and set input 1 as output data.
  1. clear the sheet.
  2. append output of merge node into the sheet.