Skip to main content

Clear Sheet

Clears the entire content and/or formatting from a worksheet, resetting it to a blank state.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.

Input

  • Client Id - The client ID from the Connect node (optional if using direct credentials).
  • Workbook Id - The workbook ID from Get Workbook or Create Workbook node.
  • Worksheet Name - Name of the worksheet to clear. Default is "Sheet1".

Options

  • Credentials - OAuth2 credentials (optional, alternative to using Client ID).
  • Clear Type - What to clear from the worksheet:
    • All - Clears both contents and formatting (default)
    • Contents - Clears only values and formulas
    • Formats - Clears only formatting
  • Confirm Clear - Must be set to true to confirm clearing. Prevents accidental clearing. Default is false.

Output

  • Success - True if the worksheet was cleared successfully.
  • Worksheet Name - Name of the worksheet that was cleared.
  • Cells Cleared - Total number of cells that were cleared.

Examples

Clear Entire Worksheet:

// Input
Worksheet Name: "Data"
Clear Type: "All"
Confirm Clear: true

// Clears all content and formatting from "Data" worksheet

Reset Worksheet for New Data:

Get Workbook
→ Clear Sheet (clear old data)
→ Set Cell Value (add headers)
→ Set Range (populate with new data)

Safety Features

  • Confirm Clear Required: You must explicitly set Confirm Clear to true
  • This prevents accidental clearing of important data
  • Clearing is permanent and cannot be undone

Use Cases

  • Reset worksheets for new automation runs
  • Clear test data after processing
  • Prepare worksheets for fresh data imports
  • Clean up temporary calculation sheets
  • Reset worksheets to blank templates

Tips

  • Always set Confirm Clear to true or the node will fail
  • Clearing does not delete the worksheet itself, only its contents
  • For clearing specific ranges, use Clear Range instead
  • Consider backing up important data before clearing
  • The worksheet structure (rows/columns) remains intact

Common Errors

ErrSafetyCheck - "Please confirm clear operation"

  • Solution: Set the "Confirm Clear" option to true

ErrInvalidArg - "Worksheet name cannot be empty"

  • Solution: Provide the name of the worksheet to clear

ErrNotFound - "Worksheet not found"

  • Solution: Verify the worksheet name is correct

ErrInvalidArg - "Workbook ID cannot be empty"

  • Solution: Ensure you've called Get Workbook first