DEV

Google Sheets

Google Sheets Connection

Put Google Sheets to Work with @Human Automations and @Human Agents

The Google Sheets Connection documents all Triggers, Actions and Query Operations available for creating automations via the Google Sheets API.

What can you do with the Google Sheets Connection?

  • Connect to the Google Sheets API in a few clicks

  • Use the related Google Sheets Operations (see below) in @Human Automations or @Human Agents

Trigger Operations

Spreadsheet Updated

Triggers on: spreadsheets/spreadsheet.updated

Triggered when the spreadsheet is updated.

Developer Metadata Changed

Triggers on: spreadsheets-developer-metadata/developer_metadata.changed

Triggered when developer metadata attached to the spreadsheet is changed.

Sheet Created

Triggers on: spreadsheets-sheets/sheet.created

Triggered when a new sheet is created in the spreadsheet.

Values Updated

Triggers on: spreadsheets-values/values.updated

Triggered when cell values in the spreadsheet are updated.

Action Operations

Action: Change Sheet Properties

Action: Copy Range

Action: Copy Worksheet

Action: Create Conditional Formatting Rule

Action: Create Multiple Spreadsheet Rows

Action: Create Spreadsheet Column

Action: Create Spreadsheet Row at Top

Action: Create Spreadsheet Row

Query Operations

Example link

Example link

Obtaining Access Credentials

Note: @Human can access all Sheets the service account has access to. Share individual sheets or an entire Google Drive folder to control which Sheets are available.

1. Create a Google Cloud project

2. Enable required APIs

  • Navigate to APIs & Services → Library.

  • Enable both the Google Sheets API and the Google Drive API.

3. Create a Service Account

  • Under Google Sheets API, go to the Credentials tab and add a new Service Account.

4. Download the JSON key

  • Open the newly created service account and go to the Keys tab.

  • Click Create new key, select JSON, and click Create.

Configuring Webhooks

1. Enable Google Drive API

  • In the Google Cloud Console, navigate to APIs & Services > Library.

  • Search for "Google Drive API" and click Enable.

2. Verify Webhook Destination Domain

  • Go to APIs & Services > Domain Verification.

  • Click "Add domain" and enter the top-level domain of your webhook URL.

  • Complete the site ownership verification through Google Search Console.

3. Configure Service Account Permissions

  • Open the Google Sheet you wish to monitor.

  • Click "Share" and add the service account email.

  • Assign at least "Viewer" permissions.

4. Register the Webhook (Watch)

  • Send an authenticated POST request to the Google Drive API watch endpoint for the spreadsheet file.

  • Specify the verified webhook URL and a unique channel ID in the request body.

5. Renew Webhook Subscriptions

  • Monitor the expiration timestamp returned by the registration response (usually 7 days).

  • Re-register the webhook channel before the expiration time to ensure continuous monitoring.

Code (Apache v2.0): Service Connectivity and Metadata

Note on discovery: At connection enable time the server uses the Drive API (drive.readonly scope) to list all spreadsheets the service account can see and injects them as dropdown options on the spreadsheetId and sheetName parameters of every registered operation. No spreadsheetId is stored in the connection config. To refresh the list after sharing new files, call POST /api/system/configured-connections/{id}/refresh-discovery.

Code (Apache v2.0): List of External Resources and Internal Mapping

Last updated