Portal Community

When to Use

Data loss warning: Clearing a sheet erases cell values permanently via the Google Sheets API. There is no undo within a workflow. The values are only recoverable via Google Sheets' own revision history (available to the spreadsheet owner for up to 30 days). Always confirm the correct SpreadsheetId and SheetName before using this operation in automated workflows.

Configuration

FieldRequiredDescription
CredentialIdRequiredInteger ID referencing a stored Google credential in the BizFirst Credentials Manager.
SpreadsheetIdRequiredThe Google Sheets spreadsheet ID from the URL.
SheetNameRequiredExact name of the tab to clear. Case-sensitive.
ClearAllOptionalBoolean. Default false. When true, clears every cell in the entire sheet including the header row. When false, clears only the rows between StartRow and EndRow (inclusive). For most use cases, leave as false and specify a row range to preserve headers.
StartRowOptionalInteger. The first row number (1-based) to include in the clear range. Required when ClearAll = false. Typically set to 2 to preserve the header row in row 1.
EndRowOptionalInteger. The last row number (1-based) to include in the clear range. Required when ClearAll = false. If you don't know the last row, use a large number (e.g. 10000) — the API will clear up to the last row with data.
Row range note: The clear operation affects all columns across the specified row range — there is no column-level restriction. To clear a specific column range, use sheet/update with blank values instead.

Validation Errors

Error CodeCause
VAL_MISSING_SPREADSHEET_IDSpreadsheetId is empty or whitespace.
VAL_MISSING_SHEET_NAMESheetName is empty or whitespace.
VAL_MISSING_ROW_RANGEClearAll = false but StartRow is not provided.
VAL_INVALID_ROW_RANGEStartRow is greater than EndRow, or either value is less than 1.
SHEET_NOT_FOUNDThe specified SheetName does not exist in the spreadsheet.

Output Fields

FieldTypeDescription
clearedRangestringA1 notation of the cell range that was cleared, e.g. "Weekly Sales!A2:Z1000" or "Weekly Sales" (full sheet).
spreadsheetIdstringEchoed spreadsheet ID.
sheetNamestringEchoed sheet/tab name.
statusstring"success".
resourcestringAlways "sheet".
operationstringAlways "clear".

Sample Configuration

{
  "resource": "sheet",
  "operation": "clear",
  "CredentialId": 12,
  "SpreadsheetId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
  "SheetName": "Weekly Sales",
  "ClearAll": false,
  "StartRow": 2,
  "EndRow": 5000
}

Sample Output

{
  "clearedRange": "Weekly Sales!A2:Z5000",
  "spreadsheetId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
  "sheetName": "Weekly Sales",
  "status": "success",
  "resource": "sheet",
  "operation": "clear"
}

Expression Reference

Assuming this node is named clearSalesData in the workflow:

ExpressionReturnsDescription
{{ $output.clearSalesData.clearedRange }}stringA1 notation of the cleared range — useful for logging.
{{ $output.clearSalesData.spreadsheetId }}stringSpreadsheet ID for passing to the subsequent write node.
{{ $output.clearSalesData.sheetName }}stringSheet name for passing to the subsequent write node.
{{ $output.clearSalesData.status }}string"success" when cleared without error.

Node Policies & GuardRails

Workflow Examples

Example 1 — Weekly Sales Report Refresh

// Trigger: Scheduled every Monday at 7 AM
// Node 1 — sheet/clear (clearOldData)
{
  "resource": "sheet", "operation": "clear",
  "CredentialId": 12,
  "SpreadsheetId": "{{ $env.SALES_SHEET_ID }}",
  "SheetName": "Weekly Sales",
  "ClearAll": false,
  "StartRow": 2,
  "EndRow": 10000
}

// Node 2 — HttpRequest: GET /api/sales/weekly for current week data
// Node 3 — sheet/append: write fresh rows to Weekly Sales
//   Uses SpreadsheetId: {{ $output.clearOldData.spreadsheetId }}
//   Uses SheetName: {{ $output.clearOldData.sheetName }}

Example 2 — Staging Area Reset After Pipeline

// At the end of a data enrichment pipeline, clear the staging sheet
// Node (final) — sheet/clear (resetStaging)
{
  "resource": "sheet", "operation": "clear",
  "CredentialId": 15,
  "SpreadsheetId": "{{ $env.PIPELINE_SHEET_ID }}",
  "SheetName": "Staging",
  "ClearAll": true
}
// ClearAll: true because staging sheet is rebuilt from scratch each run,
// including the header row, by the next pipeline execution.

Example 3 — QA Test Sheet Reset

// Before each automated test run, reset the test fixture sheet
{
  "resource": "sheet", "operation": "clear",
  "CredentialId": 20,
  "SpreadsheetId": "{{ $env.QA_SHEET_ID }}",
  "SheetName": "Test Data",
  "ClearAll": false,
  "StartRow": 2,
  "EndRow": 500
}
// After clear: append known test fixture rows
// Run assertions on downstream nodes