Skip to main content

Automations

Use DriveMate Sheets Apex Actions to manage Google Sheets spreadsheets and their data from Flows or Apex code.

DriveMate Sheets Apex Actions

Append Multiple Rows to Sheet

Action Name

Append Rows to Sheet

Description

Append multiple rows of data to a Google Sheets spreadsheet in a single API call. Use this action instead of Append Row to Sheet when all rows are available at once, to minimise API calls. This action writes data into the next available row without structurally modifying the sheet - see Append vs Append with Insert for details. Cell values starting with = are interpreted as formulas - see Using Formulas in Cell Values.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to append rows to.
  • Rows (required): List of rows to append. Each row is a comma-separated string of cell values (e.g. "Alice,30,Engineer").

Output

None

Apex Code Sample

List<GDAppendMultipleRowsInvocable.AddRowsPayload> payloads = new List<GDAppendMultipleRowsInvocable.AddRowsPayload>();

GDAppendMultipleRowsInvocable.AddRowsPayload payload = new GDAppendMultipleRowsInvocable.AddRowsPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.rows = new List<String>{ 'Alice,30,Engineer', 'Bob,25,Designer', 'Charlie,35,Manager' };

payloads.add(payload);

GDAppendMultipleRowsInvocable.appendRows(payloads);

Append Multiple Rows to Sheet (Insert New Rows)

Action Name

Append Rows to Sheet (Insert New Rows)

Description

Append multiple rows of data to a Google Sheets spreadsheet by inserting new structural rows at the end of existing data. Unlike the standard Append Rows to Sheet action, this physically inserts rows into the sheet, which pushes any content below the data further down (e.g. charts, formulas, summary rows). See Append vs Append with Insert for a detailed comparison.

Uses 3 API calls per target sheet (read values to find the last data row, insert empty rows, populate cell values). Cell values starting with = are interpreted as formulas - see Using Formulas in Cell Values.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to append rows to.
  • Sheet ID (optional): Numeric ID of the sheet. If provided, skips an extra API lookup callout.
  • Rows (required): List of rows to append. Each row is a comma-separated string of cell values (e.g. "Alice,30,Engineer").

Output

None

Apex Code Sample

List<GDAppendMultipleRowsWithInsertInvocable.AddRowsPayload> payloads = new List<GDAppendMultipleRowsWithInsertInvocable.AddRowsPayload>();

GDAppendMultipleRowsWithInsertInvocable.AddRowsPayload payload = new GDAppendMultipleRowsWithInsertInvocable.AddRowsPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.rows = new List<String>{ 'Alice,30,Engineer', 'Bob,25,Designer', 'Charlie,35,Manager' };

payloads.add(payload);

GDAppendMultipleRowsWithInsertInvocable.appendRows(payloads);

Append Single Row to Sheet

Action Name

Append Row to Sheet

Description

Append a single row of data to a Google Sheets spreadsheet. This action writes data into the next available row without structurally modifying the sheet - see Append vs Append with Insert for details.

Cell values can be provided either as a list of strings (Values) or as a single comma-separated string (Comma-Separated Values). If both are provided, the list takes precedence. Cell values starting with = are interpreted as formulas - see Using Formulas in Cell Values.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to append the row to.
  • Values (optional): Cell values as a list of strings. Provide either this or Comma-Separated Values.
  • Comma-Separated Values (optional): Cell values as a single comma-separated string (e.g. "Alice,30,Engineer"). Provide either this or Values.

Output

None

Apex Code Sample

List<GDAppendRowInvocable.AddRowPayload> payloads = new List<GDAppendRowInvocable.AddRowPayload>();

GDAppendRowInvocable.AddRowPayload payload = new GDAppendRowInvocable.AddRowPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.commaSeparatedValues = 'Alice,30,Engineer';

payloads.add(payload);

GDAppendRowInvocable.appendRow(payloads);

Append Single Row to Sheet (Insert New Row)

Action Name

Append Row to Sheet (Insert New Row)

Description

Append a single row of data to a Google Sheets spreadsheet by inserting a new structural row at the end of existing data. Unlike the standard Append Row to Sheet action, this physically inserts a row into the sheet, which pushes any content below the data further down (e.g. charts, formulas, summary rows). See Append vs Append with Insert for a detailed comparison.

Uses 3 API calls per target sheet (read values to find the last data row, insert an empty row, populate cell values). Use Append Rows to Sheet (Insert New Rows) instead when all rows are available at once.

Cell values can be provided either as a list of strings (Values) or as a single comma-separated string (Comma-Separated Values). If both are provided, the list takes precedence. Cell values starting with = are interpreted as formulas - see Using Formulas in Cell Values.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to append the row to.
  • Sheet ID (optional): Numeric ID of the sheet. If provided, skips an extra API lookup callout.
  • Values (optional): Cell values as a list of strings. Provide either this or Comma-Separated Values.
  • Comma-Separated Values (optional): Cell values as a single comma-separated string (e.g. "Alice,30,Engineer"). Provide either this or Values.

Output

None

Apex Code Sample

List<GDAppendRowWithInsertInvocable.AddRowPayload> payloads = new List<GDAppendRowWithInsertInvocable.AddRowPayload>();

GDAppendRowWithInsertInvocable.AddRowPayload payload = new GDAppendRowWithInsertInvocable.AddRowPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.commaSeparatedValues = 'Alice,30,Engineer';

payloads.add(payload);

GDAppendRowWithInsertInvocable.appendRow(payloads);

Create Sheet

Action Name

Create Sheet

Description

Create a new sheet (tab) inside an existing Google Sheets spreadsheet. Optionally populate the new sheet with initial row data.

If rows are provided, two API calls are made: one to create the sheet and a second to append the rows. Without rows, only a single API call is made. Cell values starting with = are interpreted as formulas - see Using Formulas in Cell Values.

Input Parameters

  • Spreadsheet ID (required): ID of the spreadsheet to add the sheet to.
  • Sheet Title (required): Title of the new sheet.
  • Rows (optional): List of rows to populate. Each row is a comma-separated string of cell values (e.g. "Alice,30,Engineer").

Output

  • Sheet ID: Numeric ID of the newly created sheet.
  • Sheet Title: Title of the newly created sheet.
  • Sheet Index: Zero-based position of the sheet within the spreadsheet.

Apex Code Sample

List<GDCreateSheetInvocable.CreateSheetPayload> payloads = new List<GDCreateSheetInvocable.CreateSheetPayload>();

GDCreateSheetInvocable.CreateSheetPayload payload = new GDCreateSheetInvocable.CreateSheetPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetTitle = 'Q1 Results';
payload.rows = new List<String>{ 'Month,Revenue,Expenses', 'January,10000,8000' };

payloads.add(payload);

List<GDCreateSheetInvocable.CreateSheetResponse> responses = GDCreateSheetInvocable.createSheet(payloads);

Integer sheetId = responses[0].sheetId;
String sheetTitle = responses[0].sheetTitle;
Integer sheetIndex = responses[0].sheetIndex;

Create Empty Spreadsheet

Action Name

Create Empty Spreadsheet

Description

Create a new Google Sheets spreadsheet. By default, Google Sheets names the first sheet "Sheet1" - use Initial Sheet Name to set a custom name instead.

Input Parameters

  • Spreadsheet Title (required): Title of the new spreadsheet.
  • Parent Folder Id (optional): ID of the Google Drive folder where the spreadsheet will be created. If not specified, it will be created in the root of Google Drive.
  • Initial Sheet Name (optional): Name of the default sheet created with the spreadsheet. If not specified, Google Sheets will name it "Sheet1".

Output

  • Spreadsheet ID: ID of the newly created spreadsheet.
  • Spreadsheet URL: Direct URL to open the created spreadsheet in Google Sheets.

Apex Code Sample

List<GDCreateSpreadsheetInvocable.CreateSpreadsheetPayload> payloads = new List<GDCreateSpreadsheetInvocable.CreateSpreadsheetPayload>();

GDCreateSpreadsheetInvocable.CreateSpreadsheetPayload payload = new GDCreateSpreadsheetInvocable.CreateSpreadsheetPayload();
payload.title = 'My Spreadsheet';
payload.parentFolderId = '<Parent Folder ID>';
payload.initialSheetName = 'My Data';

payloads.add(payload);

List<GDCreateSpreadsheetInvocable.CreateSpreadsheetResponse> responses = GDCreateSpreadsheetInvocable.createSpreadsheet(payloads);

String spreadsheetId = responses[0].spreadsheetId;
String spreadsheetUrl = responses[0].spreadsheetUrl;

Create Spreadsheet with Data

Action Name

Create Spreadsheet with Data

Description

Create a new Google Sheets spreadsheet together with a named sheet and its initial row data - all in a single API call.

Each row is passed as a comma-separated string of cell values (e.g. "Alice,30,Engineer"). The rows are written to the sheet in the order they are provided. Cell values starting with = are interpreted as formulas - see Using Formulas in Cell Values.

Input Parameters

  • Spreadsheet Title (required): Title of the new spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to create inside the spreadsheet.
  • Rows (required): List of rows to populate. Each row is a comma-separated string of cell values (e.g. "Alice,30,Engineer").
  • Parent Folder Id (optional): ID of the Google Drive folder where the spreadsheet will be created. If not specified, it will be created in the root of Google Drive.

Output

  • Spreadsheet ID: ID of the newly created spreadsheet.
  • Spreadsheet URL: Direct URL to open the created spreadsheet in Google Sheets.

Apex Code Sample

List<GDCreateSpreadsheetWithDataInvocable.CreateSpreadsheetWithDataPayload> payloads = new List<GDCreateSpreadsheetWithDataInvocable.CreateSpreadsheetWithDataPayload>();

GDCreateSpreadsheetWithDataInvocable.CreateSpreadsheetWithDataPayload payload = new GDCreateSpreadsheetWithDataInvocable.CreateSpreadsheetWithDataPayload();
payload.title = 'My Spreadsheet';
payload.sheetName = 'Employees';
payload.rows = new List<String>{ 'Name,Age,Role', 'Alice,30,Engineer', 'Bob,25,Designer' };
payload.parentFolderId = '<Parent Folder ID>';

payloads.add(payload);

List<GDCreateSpreadsheetWithDataInvocable.CreateSpreadsheetResponse> responses = GDCreateSpreadsheetWithDataInvocable.createSpreadsheet(payloads);

String spreadsheetId = responses[0].spreadsheetId;
String spreadsheetUrl = responses[0].spreadsheetUrl;

Delete Multiple Rows from Sheet

Action Name

Delete Rows from Sheet

Description

Delete multiple rows from a Google Sheets spreadsheet in a single API call. Row numbers are 1-based, so row 1 is the first row (e.g. a header), and row 2 is the first data row. Rows are always deleted in descending order to prevent row index shifting.

The sheet can be identified either by Sheet Name or by Sheet ID. Using Sheet ID is more efficient as it avoids an extra API lookup callout.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (optional): Name of the sheet (tab). Provide either this or Sheet ID.
  • Sheet ID (optional): Numeric ID of the sheet. Provide either this or Sheet Name. Skips an extra API lookup callout.
  • Row Numbers (required): List of 1-based row numbers to delete (e.g. [2, 5, 7]).

Output

None

Apex Code Sample

List<GDDeleteMultipleRowsInvocable.DeleteRowsPayload> payloads = new List<GDDeleteMultipleRowsInvocable.DeleteRowsPayload>();

GDDeleteMultipleRowsInvocable.DeleteRowsPayload payload = new GDDeleteMultipleRowsInvocable.DeleteRowsPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.rowNumbers = new List<Integer>{ 2, 5, 7 };

payloads.add(payload);

GDDeleteMultipleRowsInvocable.deleteRows(payloads);

Delete Rows by Criteria

Action Name

Delete Rows by Criteria

Description

Delete rows from a Google Sheets spreadsheet that match the given filter criteria. See Row Matching Criteria for the criteria format and Matching Option for supported values.

If no rows match the criteria, the action succeeds silently without making a delete call.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to search and delete from.
  • Sheet ID (optional): Numeric ID of the sheet. If provided, skips an extra API lookup callout.
  • Criteria (required): JSON string defining the row matching criteria.
  • Matching Option (optional): Which matching rows to delete (default: all).

Output

None

Apex Code Sample

List<GDDeleteRowsByCriteriaInvocable.DeleteRowsByCriteriaPayload> payloads = new List<GDDeleteRowsByCriteriaInvocable.DeleteRowsByCriteriaPayload>();

GDDeleteRowsByCriteriaInvocable.DeleteRowsByCriteriaPayload payload = new GDDeleteRowsByCriteriaInvocable.DeleteRowsByCriteriaPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.criteria = '{"conditions":[{"column":"A","operator":"=","value":"Alice"}]}';
payload.matchingOption = 'first_only';

payloads.add(payload);

GDDeleteRowsByCriteriaInvocable.deleteRowsByCriteria(payloads);

Delete Rows by Criteria (Async)

Action Name

Delete Rows by Criteria (Async)

Description

Asynchronous equivalent of Delete Rows by Criteria. Enqueues a background job so the calling Flow does not consume a callout and action can be invoked from a synchronous flow path.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to search and delete from.
  • Sheet ID (optional): Numeric ID of the sheet. If provided, skips an extra API lookup callout.
  • Criteria (required): JSON string defining the row matching criteria.
  • Matching Option (optional): Which matching rows to delete (default: all).

Output

None

Apex Code Sample

List<GDDeleteRowsByCriteriaInvocable.DeleteRowsByCriteriaPayload> payloads = new List<GDDeleteRowsByCriteriaInvocable.DeleteRowsByCriteriaPayload>();

GDDeleteRowsByCriteriaInvocable.DeleteRowsByCriteriaPayload payload = new GDDeleteRowsByCriteriaInvocable.DeleteRowsByCriteriaPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.criteria = '{"conditions":[{"column":"A","operator":"=","value":"Alice"}]}';
payload.matchingOption = 'first_only';

payloads.add(payload);

GDDeleteRowsByCriteriaInvocableAsync.deleteRowsByCriteria(payloads);

Delete Sheet

Action Name

Delete Sheet

Description

Delete a sheet (tab) from a Google Sheets spreadsheet. The sheet is identified by name.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to delete.

Output

None

Apex Code Sample

List<GDDeleteSheetInvocable.DeleteSheetPayload> payloads = new List<GDDeleteSheetInvocable.DeleteSheetPayload>();

GDDeleteSheetInvocable.DeleteSheetPayload payload = new GDDeleteSheetInvocable.DeleteSheetPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';

payloads.add(payload);

GDDeleteSheetInvocable.deleteSheet(payloads);

Delete Single Row from Sheet

Action Name

Delete Row from Sheet

Description

Delete a single row from a Google Sheets spreadsheet. Row numbers are 1-based, so row 1 is the first row (e.g. a header), and row 2 is the first data row.

The sheet can be identified either by Sheet Name or by Sheet ID. Using Sheet ID is more efficient as it avoids an extra API lookup callout.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (optional): Name of the sheet (tab). Provide either this or Sheet ID.
  • Sheet ID (optional): Numeric ID of the sheet. Provide either this or Sheet Name. Skips an extra API lookup callout.
  • Row Number (required): 1-based number of the row to delete (e.g. 2 = first data row after a header).

Output

None

Apex Code Sample

List<GDDeleteRowInvocable.DeleteRowPayload> payloads = new List<GDDeleteRowInvocable.DeleteRowPayload>();

GDDeleteRowInvocable.DeleteRowPayload payload = new GDDeleteRowInvocable.DeleteRowPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.rowNumber = 2;

payloads.add(payload);

GDDeleteRowInvocable.deleteRow(payloads);

Edit Rows in Sheet

Action Name

Edit Rows in Sheet

Description

Update specific cells in Google Sheets rows that match the given filter criteria. Only the columns specified in Updates are changed; all other columns are left untouched. See Row Matching Criteria for the criteria format and Matching Option for supported values.

Updates is a semicolon-separated string specifying which columns to update and with what value (e.g. "B=31;C=Manager"). The first = in each segment separates the column from the value. Values starting with = are interpreted as formulas - see Using Formulas in Cell Values.

If no rows match the criteria, the action succeeds silently without making an update call.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to search and update.
  • Criteria (required): JSON string defining the row matching criteria.
  • Updates (required): Semicolon-separated column update string (e.g. "B=NewValue;C=OtherValue").
  • Matching Option (optional): Which matching rows to update (default: all).

Output

None

Apex Code Sample

List<GDEditRowInvocable.EditRowPayload> payloads = new List<GDEditRowInvocable.EditRowPayload>();

GDEditRowInvocable.EditRowPayload payload = new GDEditRowInvocable.EditRowPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.criteria = '{"conditions":[{"column":"A","operator":"=","value":"Alice"}]}';
payload.updates = 'B=31;C=Senior Engineer';
payload.matchingOption = 'first_only';

payloads.add(payload);

GDEditRowInvocable.editRows(payloads);

Find Row in Sheet

Action Name

Find Row in Sheet

Description

Find a row in a Google Sheets spreadsheet that matches the given filter criteria. Returns the 1-based row number of the matching row, or -1 if no match is found. See Row Matching Criteria for the criteria format.

By default, the first matching row is returned. Set Matching Option to last_only to return the last match instead. See Matching Option.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to search.
  • Criteria (required): JSON string defining the row matching criteria.
  • Matching Option (optional): Which match to return: first_only (default) or last_only.

Output

  • Row Number: 1-based row number of the matching row, or -1 if no match was found.
  • Found: true if a matching row was found, false otherwise.

Apex Code Sample

List<GDFindRowInvocable.FindRowPayload> payloads = new List<GDFindRowInvocable.FindRowPayload>();

GDFindRowInvocable.FindRowPayload payload = new GDFindRowInvocable.FindRowPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.criteria = '{"conditions":[{"column":"A","operator":"=","value":"Alice"}]}';
payload.matchingOption = 'first_only';

payloads.add(payload);

List<GDFindRowInvocable.FindRowResponse> responses = GDFindRowInvocable.findRow(payloads);

Integer rowNumber = responses[0].rowNumber;
Boolean found = responses[0].found;

Insert Multiple Rows into Sheet

Action Name

Insert Rows into Sheet

Description

Insert one or more rows at a specific position in a Google Sheets spreadsheet, pushing existing rows down. Row numbers are 1-based (e.g. 3 = insert before current row 3, pushing it and everything below it down).

Values are optional - omit them to insert blank rows. Cell values starting with = are interpreted as formulas - see Using Formulas in Cell Values.

The sheet can be identified either by Sheet Name or by Sheet ID. Using Sheet ID is more efficient as it avoids an extra API lookup callout.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to insert rows into.
  • Sheet ID (optional): Numeric ID of the sheet. If provided, skips an extra API lookup callout.
  • Row Number (required): 1-based row number where the new rows will be inserted.
  • Rows (optional): List of rows to insert, each as a comma-separated string (e.g. "Alice,30"). If omitted, blank rows are inserted.

Output

None

Apex Code Sample

List<GDInsertMultipleRowsInvocable.InsertRowsPayload> payloads = new List<GDInsertMultipleRowsInvocable.InsertRowsPayload>();

GDInsertMultipleRowsInvocable.InsertRowsPayload payload = new GDInsertMultipleRowsInvocable.InsertRowsPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.rowNumber = 3;
payload.rows = new List<String>{ 'Alice,30,Engineer', 'Bob,25,Designer' };

payloads.add(payload);

GDInsertMultipleRowsInvocable.insertRows(payloads);

Insert Single Row into Sheet

Action Name

Insert Row into Sheet

Description

Insert a single row at a specific position in a Google Sheets spreadsheet, pushing existing rows down. Row numbers are 1-based (e.g. 3 = insert before current row 3, pushing it down).

Values are optional - omit them to insert a blank row. Use Insert Rows into Sheet instead when all rows are available at once.

Cell values can be provided either as a list of strings (Values) or as a single comma-separated string (Comma-Separated Values). If both are provided, the list takes precedence. Cell values starting with = are interpreted as formulas - see Using Formulas in Cell Values.

The sheet can be identified either by Sheet Name or by Sheet ID. Using Sheet ID is more efficient as it avoids an extra API lookup callout.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to insert the row into.
  • Sheet ID (optional): Numeric ID of the sheet. If provided, skips an extra API lookup callout.
  • Row Number (required): 1-based row number where the new row will be inserted (e.g. 3 = insert before current row 3, pushing it down).
  • Values (optional): Cell values as a list of strings. Provide either this or Comma-Separated Values.
  • Comma-Separated Values (optional): Cell values as a single comma-separated string (e.g. "Alice,30,Engineer"). Provide either this or Values.

Output

None

Apex Code Sample

List<GDInsertRowInvocable.InsertRowPayload> payloads = new List<GDInsertRowInvocable.InsertRowPayload>();

GDInsertRowInvocable.InsertRowPayload payload = new GDInsertRowInvocable.InsertRowPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.rowNumber = 3;
payload.commaSeparatedValues = 'Alice,30,Engineer';

payloads.add(payload);

GDInsertRowInvocable.insertRow(payloads);

Rename Sheet

Action Name

Rename Sheet

Description

Rename a sheet (tab) in a Google Sheets spreadsheet.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Current name of the sheet (tab) to rename.
  • New Sheet Name (required): New name for the sheet.

Output

None

Apex Code Sample

List<GDRenameSheetInvocable.RenameSheetPayload> payloads = new List<GDRenameSheetInvocable.RenameSheetPayload>();

GDRenameSheetInvocable.RenameSheetPayload payload = new GDRenameSheetInvocable.RenameSheetPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Sheet1';
payload.newSheetName = 'Q1 Results';

payloads.add(payload);

GDRenameSheetInvocable.renameSheet(payloads);

Show or Hide Sheet

Action Name

Show or Hide Sheet

Description

Show or hide a sheet (tab) in a Google Sheets spreadsheet. A spreadsheet must always have at least one visible sheet - attempting to hide the only visible sheet will result in an error from the Google Sheets API.

Input Parameters

  • Spreadsheet ID (required): ID of the target spreadsheet.
  • Sheet Name (required): Name of the sheet (tab) to show or hide.
  • Hidden (required): Set to true to hide the sheet, or false to show it.

Output

None

Apex Code Sample

List<GDChangeSheetVisibilityInvocable.ChangeSheetVisibilityPayload> payloads = new List<GDChangeSheetVisibilityInvocable.ChangeSheetVisibilityPayload>();

GDChangeSheetVisibilityInvocable.ChangeSheetVisibilityPayload payload = new GDChangeSheetVisibilityInvocable.ChangeSheetVisibilityPayload();
payload.spreadsheetId = '<Spreadsheet ID>';
payload.sheetName = 'Secret Data';
payload.hidden = true;

payloads.add(payload);

GDChangeSheetVisibilityInvocable.changeSheetVisibility(payloads);

Shared Concepts

Bulk Execution

All Sheets actions support bulk execution. Each action accepts a list of payloads, and payloads targeting the same sheet (or the same sheet and row position for insert actions) are automatically combined so that only one set of API calls is made per unique target. This means that when a record-triggered flow fires for multiple records, the action batches all resulting payloads efficiently rather than making separate calls for each record.


Append vs Append with Insert

DriveMate offers two ways to add rows to the end of a sheet: standard append and append with insert. They differ in how they interact with the Google Sheets grid.

Standard append (Append Row to Sheet, Append Rows to Sheet) uses the Google Sheets :append API to write data into the next available row after existing data. It does not structurally modify the sheet - it simply fills empty cells. This is fast (1 API call per target sheet) and is the right choice for most scenarios.

Append with insert (Append Row to Sheet (Insert New Row), Append Rows to Sheet (Insert New Rows)) first reads the sheet to find the last data row, then structurally inserts new rows at that position, then populates them with values. Because new rows are physically added to the grid, any content below the data - charts, summary rows, formulas, conditional formatting - is pushed further down automatically.

Standard AppendAppend with Insert
API calls per target sheet13 (read values + insert rows + populate cells)
Pushes content below data downNoYes
Best forMost data entry scenariosSheets with charts, totals, or other content positioned below the data
tip

Both variants bulkify by target sheet - multiple rows targeting the same sheet are combined into a single set of API calls regardless of how many payloads are passed. However, append with insert consumes 3 callouts per target sheet compared to 1 for standard append. If your transaction makes other callouts and you need to be mindful of the remaining callout budget, prefer the standard append actions unless you specifically need content below the data to shift down.


Using Formulas in Cell Values

All actions that write cell values - Create Spreadsheet with Data, Create Sheet, Append Row to Sheet, Append Rows to Sheet, Append Row to Sheet (Insert New Row), Append Rows to Sheet (Insert New Rows), Insert Row into Sheet, Insert Rows into Sheet, and Edit Rows in Sheet - support Google Sheets formulas. Any value starting with = is interpreted as a formula by Google Sheets.

For example, to set a cell to the sum of columns C and D on the same row, use the INDIRECT and ROW functions to build a row-independent formula:

=INDIRECT("C"&ROW())+INDIRECT("D"&ROW())

This resolves to C3+D3 on row 3, C5+D5 on row 5, and so on - regardless of where the row is inserted. This is useful when appending rows to a sheet that already has a formula convention.

Examples

GoalCell value
Static number100
Static textHello
Sum of C and D (same row)=INDIRECT("C"&ROW())+INDIRECT("D"&ROW())
Percentage of column B (same row)=INDIRECT("B"&ROW())*0.1
Reference a fixed cell=A1*2

In the Edit Rows in Sheet Updates parameter, the first = separates the column from the value. A formula therefore appears with two = signs - the delimiter and the formula prefix:

E==INDIRECT("C"&ROW())+INDIRECT("D"&ROW())

This is parsed as column E with value =INDIRECT("C"&ROW())+INDIRECT("D"&ROW()).

For more details on these functions, see the Google Sheets documentation for INDIRECT and ROW.


Row Matching Criteria

Several actions (Find Row in Sheet, Edit Rows in Sheet, Delete Rows by Criteria) accept a Criteria parameter - a JSON string that defines which rows to match.

{
"conditions": [
{ "column": "A", "operator": "=", "value": "Alice" },
{ "column": "B", "operator": ">", "value": "25" }
],
"conditionLogic": "1 AND 2"
}
  • conditions: list of individual filter conditions. Each condition references a column by its letter (A, B, AA, …), a comparison operator, and a value.
  • conditionLogic: optional expression combining condition numbers (e.g. "(1 OR 2) AND 3"). When omitted, all conditions must match (AND logic).

Supported operators: =, !=, >, <, >=, <=, CONTAINS, STARTS_WITH.

Numeric comparisons are attempted automatically - if both the cell value and the condition value can be parsed as numbers, a numeric comparison is used. Otherwise, string comparison applies.

Matching Option

Actions that use row matching criteria also accept a Matching Option parameter that controls which of the matched rows are acted upon. Accepted values (case-insensitive):

  • all (default) - act on all matching rows.
  • first_only - act on only the first matching row.
  • last_only - act on only the last matching row.

Invalid values are silently ignored and fall back to all.