Google Sheets
Overview
This doc outlines how to use the Google Sheets connector to manage your engagement campaigns and import data for unified analysis and workflow creation.
Setup
Create Connector
From the settings panel or from the node catalog, search for the Google Sheets integration and navigate to the 'Create connector' view.
Configure the Connector
Click on the authenticate button and log in with your Google OAuth credentials or configure a Google Service Account to grant Cargo access to your Google Sheets.
Using OAuth Authentication
Authenticate using your Google account:
- Click on the Authenticate button.
- Log in with your Google credentials.
- Grant Cargo access to your Google Sheets.
Using a Service Account
To use a Google Service Account instead of OAuth, follow these steps:
-
Create a Google Cloud Project
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
-
Enable Google Sheets API
- Navigate to APIs & Services > Library.
- Search for Google Sheets API and enable it.
- (Optional) Enable Google Drive API if needed.
-
Create a Service Account
- Go to APIs & Services > Credentials.
- Click Create Credentials > Service Account.
- Fill in the details and click Create.
- Assign a role such as Editor.
- Click Done.
-
Generate a Service Account Key
- In the Service Accounts section, open the created account.
- Navigate to the Keys tab and click Add Key > Create new key.
- Select JSON format and download the key file.
-
Share the Google Sheet with the Service Account
- Open your Google Sheet.
- Click Share.
- Copy the client email from the JSON key file (under
client_email
). - Paste it into the Share field and grant Editor access.
-
Add the Service Account JSON in Cargo
- Instead of logging in via OAuth, paste the entire Service Account JSON string in the authentication settings when setting up the Google Sheets connector.
Using a Service Account increases the API rate limit to 150 requests per minute per project, compared to 60 requests per minute per user with OAuth.
Actions
Write - Create a new record in Google Sheets
Add the spreadsheet ID and worksheet, and add the content of the new record to the mappings. Choose from an existing column or define a new column in your Google Sheet using the connector.
Write - Upsert record in Google Sheets
Use an expression to define the matching value for a record to identify an existing row against a matching property name. Choose from an existing column or define a new column in your Google Sheet using the connector.
FAQ
Which rate limits should I set for this connector?
The advised rate limit for the Google Sheets connector is below 10 requests per minute. However, using a Service Account increases the limit to 150 requests per minute per project.
Does a sheet need to have shared permissions to be loaded as a data loader?
The OAuth connection with Google Sheets means the shared permissions of a Google Sheet don't impact its loading into a Cargo data model. However, if using a Service Account, you must manually share the sheet with the service account’s email.