In this guide:
Okta Workflows guides
Okta Workflows guides offer questions and answers from the Okta Workflows community office hours. They also come from the #okta-workflows channel on the Mac Admins Slack and other places. Read all the other guides.
How do you delete all rows in a Google Sheets spreadsheet using Okta Workflows?
This guide will teach you how to delete all rows in a Google Sheets spreadsheet using Okta Workflows.
Delete Google Sheets rows
You need to delete all the rows in the following spreadsheet except the headers:

Workflows flow
This flow deletes a range of rows from a Google Sheets spreadsheet using the Google Sheets API:

How the flow works
- The Flow Control-Assign card sets the Google Sheets spreadsheet ID.
- The Text-Compose card builds the API URL: /v4/spreadsheets/{Spreadsheet ID}:batchUpdate. It uses the Spreadsheet ID from the Assign card.
- The second Text-Compose card builds the JSON request body. It uses the deleteDimension request to delete rows 2–11 (startIndex: 1, endIndex: 11) from the first sheet (sheetId: 0). Update startIndex and endIndex to match the rows you want to delete.
- The Google Sheets-Custom API Action card makes a POST request to the Google Sheets spreadsheets.batchUpdate API.
JSON request indicating rows to clear:
{ "requests": [ { "deleteDimension": { "range": { "sheetId": 0, "dimension": "ROWS", "startIndex": 1, "endIndex": 11 } } } ]}
Run the flow
Running the flow will clear all the spreadsheet rows:

Related Okta Workflows guides
- Export Google Sheets Data to an Okta Workflows Table.
- Save User MFA Information to a Google Sheets Spreadsheet in Okta Workflows.
Okta Workflows resources
- 🚀 New to Okta Workflows? The Getting Started with Okta Workflows page has all the resources to help you get started.
- 📺 Like learning from videos? Watch Okta Workflows videos.
- ❓Have a question? Ask during community office hours or post on the community forum.
- 🙋♀️ Want to learn from the community? Join the #okta-workflows channel on the Mac Admins Slack.
- 📖 Want to learn more about identity automation? Take the Okta Workflows training on Okta Learning.
Leave a Reply