Docs / Strand / connectors/google-sheets

Google Sheets Connector

Direction: Read / Write | Type: google_sheets

Read, write, and manage spreadsheet data in Google Sheets from your Strand workflows via the Sheets API v4.

Prerequisites#

You need a Google Service Account with access to your spreadsheet:

  1. Go to console.cloud.google.com
  2. Create a new project (or select an existing one)
  3. Enable the Google Sheets API: APIs & Services > Library > search "Google Sheets API" > Enable
  4. Create a service account: IAM & Admin > Service Accounts > Create Service Account
  5. Create a key: click the service account > Keys > Add Key > JSON > Download
  6. Share your spreadsheet with the service account email (e.g., my-bot@my-project.iam.gserviceaccount.com) as an Editor
Tip: The service account email is in the JSON key file under client_email. You must share each spreadsheet with this email for the connector to access it.

Connector Setup#

Create a Google Sheets connector from the Connectors page.

Configuration Fields#

Field Required Description
Name Yes Friendly name (e.g., "Sales Tracker Sheet")
Authentication Type No service_account (JSON key, below) or oauth (recommended — authorize in a popup, no key file). Default: service_account. See OAuth below.
Service Account Key Conditional Full JSON contents of the service account key file (encrypted at rest). Required when Authentication Type is service_account.
Spreadsheet ID No Default spreadsheet ID (can be overridden per node). Found in the URL: docs.google.com/spreadsheets/d/{ID}/edit
Timeout No Request timeout in seconds (default: 30)

Instead of creating a service account and sharing each spreadsheet with it, set Authentication Type to oauth and click Connect. You authorize Strand against your Google account in a popup window, and the access token is stored encrypted and refreshed automatically — no key file, and no per-spreadsheet sharing. You still set a default Spreadsheet ID (or pass one per node). The service-account Prerequisites above apply only to the service_account path.

Operations#

Read Range#

Read cell values from a spreadsheet range.

Field Required Description
Spreadsheet ID No Override the connector's default spreadsheet ID
Range Yes A1 notation range (e.g., Sheet1!A1:D10)
Value Render No How values are rendered: Formatted (default), Unformatted, or Formula

Example: Read a table

Append Rows#

Append rows to the end of a table in a spreadsheet.

Field Required Description
Spreadsheet ID No Override the connector's default spreadsheet ID
Range Yes Range indicating the table to append to (e.g., Sheet1!A1)
Values (JSON) Yes 2D array of values as JSON. Supports Jinja templates.
Value Input No How input is interpreted: User Entered (default, parses formulas) or Raw

Example: Append a row from event data

json

[["{{ payload.name }}", "{{ payload.email }}", "{{ payload.date }}", "{{ payload.amount }}"]]

Example: Append multiple rows

json

[
  ["Alice", "alice@example.com", "2025-01-15", 100],
  ["Bob", "bob@example.com", "2025-01-16", 250]
]

Update Range#

Update specific cells in a spreadsheet.

Field Required Description
Spreadsheet ID No Override the connector's default spreadsheet ID
Range Yes A1 notation range to update (e.g., Sheet1!A1:B2)
Values (JSON) Yes 2D array of values as JSON
Value Input No How input is interpreted: User Entered (default) or Raw

Clear Range#

Clear all values from a range (formatting is preserved).

Field Required Description
Spreadsheet ID No Override the connector's default spreadsheet ID
Range Yes A1 notation range to clear (e.g., Sheet1!A2:D100)

Get Spreadsheet Info#

Get spreadsheet metadata including sheet names and dimensions.

Field Required Description
Spreadsheet ID No Override the connector's default spreadsheet ID

Output#

Read Range Output#

json

{
  "success": true,
  "status": "completed",
  "data": {
    "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
    "range": "Sheet1!A1:D3",
    "values": [
      ["Name", "Email", "Date", "Amount"],
      ["Alice", "alice@example.com", "2025-01-15", "100"],
      ["Bob", "bob@example.com", "2025-01-16", "250"]
    ],
    "row_count": 3
  },
  "service": "google_sheets",
  "operation": "read_range"
}

Key fields for subsequent nodes:

Append Rows Output#

json

{
  "success": true,
  "status": "completed",
  "data": {
    "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
    "updated_range": "Sheet1!A4:D4",
    "updated_rows": 1,
    "updated_cells": 4
  },
  "service": "google_sheets",
  "operation": "append_rows"
}

Get Spreadsheet Info Output#

json

{
  "success": true,
  "status": "completed",
  "data": {
    "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms",
    "title": "Sales Tracker",
    "sheets": [
      {"sheet_id": 0, "title": "Sheet1", "row_count": 1000, "column_count": 26},
      {"sheet_id": 123, "title": "Summary", "row_count": 100, "column_count": 10}
    ],
    "sheet_count": 2
  },
  "service": "google_sheets",
  "operation": "get_spreadsheet"
}

Errors#

Error Meaning
Google authentication failed Service account key is invalid or expired.
Access denied Spreadsheet not shared with the service account email.
Spreadsheet or range not found Check the spreadsheet ID and range notation.
PyJWT library is required A platform-side dependency issue. If you see this, contact support.

Example Workflow#

  1. Create Connector with your service account key and default spreadsheet ID
  2. Read Range to get current data: Sheet1!A1:D100
  3. Logic node to check if a condition is met
  4. Append Rows to log new data:

Limitations#