Deleting Multiple Rows in Google Sheets

I would like to delete multiple rows in a Google Sheets file. From the list of options there you can only delete one row. Anybody have any ideas?

Hey @Charles_Henderson

This is indeed very possible and it just depends on the kind of module that you have placed before the ‘Delete a row’ module.

For example, if you use the ‘Get a Range’ module to retrieve the range of rows to be deleted, then you can simply map in the ‘Row ID’ into the ‘Delete’ module:

This way, all rows retrieved would be deleted in a single run. I hope this helps you.

2 Likes

If you want to delete lots of rows (e.g.: >50), you won’t want to use 50 operations to delete the rows.

You can delete them in a single operation if you use the spreadsheets.batchUpdate endpoint with a DeleteRangeRequest, using the Google Sheets “Make an API Call” module.

It would be similar to How to bulk update non-consecutive rows in Google Sheets using the batchUpdate API? - #3 by samliew, with different endpoints.

3 Likes

Sorry, but that didn’t work. I received a RuntimeError

400: INVALID_ARGUMENT - Invalid value at ‘requests.delete_dimension.range.sheet_id’ (TYPE_INT32), “ASC”

Thanks. But, honestly, over my head. Thanks anyway.

Can you share screenshots of how you set up both modules?

2 Likes

Hello, i have the same problem:
400: INVALID_ARGUMENT - Invalid value at ‘requests.delete_dimension.range.sheet_id’ (TYPE_INT32), “Effectif”
please help me, i don’t find solution :frowning:
image