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.

4 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

Hola Amigo!. EncontrĂŠ este ejemplo en la comunidad de cĂłmo usar DeleteRangeRequest. Espero te ayude!

Welcome to the Make community!

Could you please create a separate topic for this?

While it’s tempting to continue an existing thread, a more effective approach would be to start a new topic. It helps other community users to respond to your query, and keeps our space organised for everyone. If you start a new conversation you are also more likely to get help from other users. You can refer others back to a related topic by including that link in your question. Thank you for understanding and keeping our community neat and tidy.

The “New Topic” link can be found in the top-right of the header:

Join the Make Fans Discord server to chat with other makers!

1 Like