Deleting Dynamic Non-Consecutive Rows in Google Sheets

I’ve been going crazy the last few days trying to make the bulk deleting Google Sheets rows via Make an API call work but am still struggling.

My scenario produces a clean, comma-separated string of row numbers, already sorted in descending order [{“text”: “25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2”}] and my goal is to map this string into the requests array for the spreadsheets.batchUpdate endpoint in my Make an API Call module.

However, my current automation fails with a parseNumber error, as it’s trying to parse the entire string at once instead of each individual number. What’s the best, non-JavaScript method to iterate over a string like this and build the JSON structure for the API call?


UPDATE: SOLVED :tada:

Here’s the final setup I used:

  1. Google Sheets Search Rows → Outputs individual bundles per row
  2. Array Aggregator → Collects bundles into delete request format
  3. JSON > Create JSON → Formats the array properly
  4. Make an API Call → Single batchUpdate request

This was a bit tricky to solve as I spent a TON of time trying to build the JSON directly in the body function of the Make an API Call module which was giving me a wild amount of errors. Instead, I found formatting the JSON beforehand and passing this along was a way cleaner approach.

4 Likes