How to bulk update non-consecutive rows in Google Sheets using the batchUpdate API?

1. Build each row (range) JSON data

So first, you’ll need to build the JSON data for each row.

While you can use the “Aggregate to JSON” module, a simpler way would be to use the “Text Aggregator”:

{
  "range": "'A{{rownum}}:B{{rownum}}",
  "majorDimension": "ROWS",
  "values": [[
    "{{col1_value}}",
    "{{col2_value}}",
    ... more columns
  ]]
}

2. Insert into Sheets data array

Then, you can insert this aggregated JSON data into the Sheets module like this:

Screenshot_2024-01-18_100117

3 Likes