Configure Connection
Google Sheets guide
Configure service account access to Google Sheets, add up to five spreadsheet IDs, and test access to the first spreadsheet.
Before you startDirect link to Before you start
Google Sheets uses the same service account, domain-wide delegation, and P12 certificate connection method as Google Workspace. Use the Sheets API and Sheets scope below in place of that guide's Workspace API and scope lists.
NIM requires Client ID, Tenant ID, and Certificate, plus the first Sheet ID. You can configure up to five spreadsheet IDs in one system. This connector reads spreadsheet data as a source for NIM.
Create the service account and enable Sheets APIDirect link to Create the service account and enable Sheets API
-
Follow the service account and P12 key instructions in the Google Workspace connection guide, creating a Google Sheets system in NIM for this integration.
-
In the Google Cloud project used by the service account, enable the Sheets API in Cloud Shell:
gcloud services enable sheets.googleapis.com -
Record the service account's email address and numeric Unique ID, and retain the downloaded P12 certificate and its password.
Configure domain-wide delegationDirect link to Configure domain-wide delegation
-
In the Google Admin console, open Security > Access and data control > API controls > Manage Domain Wide Delegation.
-
Add the service account's numeric client ID (Unique ID) and authorize this scope:
https://www.googleapis.com/auth/spreadsheets -
Identify the Google Workspace user whose email address NIM will use as Tenant ID. Confirm that this user can read each spreadsheet you intend to collect.
See Google's domain-wide delegation guidance for administrator requirements.
Enter credentials and spreadsheet IDsDirect link to Enter credentials and spreadsheet IDs
- Add the P12 certificate to NIM using the password supplied when the key was created.
- Open the Google Sheets system's Connection screen.
- Enter the following settings and save the connection.
| NIM setting | Value |
|---|---|
| Client ID | The service account email address, as in the Google Workspace connection method. |
| Tenant ID | The Google Workspace user email address on whose behalf NIM accesses the spreadsheets. |
| Certificate | The P12 certificate added to NIM for that service account. |
| Sheet ID | The first spreadsheet ID. Required for the connection test. |
| Additional Sheet IDs | Up to four additional spreadsheet IDs, for a maximum of five in total. |
The numeric client ID authorized in Google Admin differs from the service account email entered as Client ID in NIM.
Use the spreadsheet ID from the document URL:
https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit
Enter SPREADSHEET_ID, rather than the full URL or a worksheet tab's numeric gid. Google's Sheets API overview explains the distinction between spreadsheet and sheet IDs.
Test the first spreadsheetDirect link to Test the first spreadsheet
-
Select Test Connection. NIM calls:
GET https://sheets.googleapis.com/v4/spreadsheets/{sheet_id}NIM replaces
{sheet_id}with the first Sheet ID configured in the connection. -
Confirm that the test succeeds. If it fails, check the Sheets API, delegated scope, service account email, Tenant ID, certificate, first spreadsheet ID, and that user's access to the spreadsheet.
-
Collect the system and inspect the configured spreadsheet collections: sheet_data, sheet2_data, sheet3_data, sheet4_data, and sheet5_data, as applicable.
-
Validate the collected rows and matching rules before using the spreadsheets as a source for downstream automation.
The connection test checks only the first spreadsheet. Validate each additional spreadsheet by collecting its data.