Google Sheets
This page contains the setup guide and reference information for Google Sheets.
Features
Feature | Supported? |
---|---|
Full Refresh - Overwrite | Yes |
Full Refresh - Append | Yes |
Prerequisites
- Google Cloud Console access
- A Google Cloud Platform (GCP) project
- Enable the Google Sheets API in your GCP project
- Service Account Key with access to the Spreadsheet you want to replicate
Setup guide
Step 1: Create a Service Account for authentication
Go to the Service Accounts page in the Google Developers console.
Select the project you want to use (or create a new one).
Click + Create Service Account at the top of the page.
Enter a name for the service account, and click Create and Continue.
Choose the role for the service account. We recommend the Viewer role (Read & Analyze permissions). Click Continue. And then click Done.
Select your new service account from the list, and open the Keys tab. Click Keys > Add Key.
Select JSON as the Key type. Then click Create. This will generate and download the JSON key file that you'll use for authentication.
Step 2: Enable the Google Sheets API
Go to the API Console/Librar page.
Make sure you have selected the correct project from the top.
Find and select the Google Sheets API.
Click ENABLE.
NOTE: If your spreadsheet is viewable by anyone with its link, no further action is needed and you can proceed to Step 4. If not, give your Service account access to your spreadsheet by following Step 3.
Step 3: Give your Service account access to your spreadsheet
Go to Google Cloud Service accounts and find your service account email. Copy it.
Open the Google Sheets you want to sync, and click Share in the top right corner.
Enter your Service account email, give it Viewer access, and click Share.
Step 4: Obtain Google Sheets link
Go to the Google spreadsheet you want to sync, click Share in the top right corner, and click Copy Link.
You're ready to set up Google Sheets in Daspire!
Step 5: Set up Google Sheets in Daspire
Select Google Sheets from the Source list.
Enter a Source Name.
In authentication method, select Service Account Key Authentication and enter your Google Cloud service account key you obtained in Step 1 in JSON format:
{
"type": "service_account",
"project_id": "YOUR_PROJECT_ID",
"private_key_id": "YOUR_PRIVATE_KEY",
...
}
For Spreadsheet Link, enter the link to the Google spreadsheet you obtained in Step 4.
(Optional) You may enable the option to Convert Column Names to SQL-Compliant Format. Enabling this option will allow the connector to convert column names to a standardized, SQL-friendly format. For example, a column name of
Café Earnings 2022
will be converted tocafe_earnings_2022
. We recommend enabling this option if your target destination is SQL-based (ie Postgres, MySQL). Set to false by default.Click Save & Test.
Output schema
Each sheet in the selected spreadsheet is synced as a separate stream. Each selected column in the sheet is synced as a string field.
Data type mapping
Integration Type | Daspire Type |
---|---|
Any type | string |
Performance considerations
The Google API rate limits are:
- 300 read requests per minute per project
- 60 requests per minute per user per project
Daspire batches requests to the API in order to efficiently pull data and respect these rate limits. We recommend not using the same user or service account for more than 3 instances of the Google Sheets source integration to ensure high transfer speeds.
Troubleshooting
If your sheet is completely empty (no header rows) or deleted, Daspire will not delete the table in the destination. If this happens, the sync logs will contain a message saying the sheet has been skipped when syncing the full spreadsheet.
Source setup will fail if the speadsheet is not a Google Sheets file. If the file was saved or imported as another file type the setup could fail.
Max number of tables that can be synced at a time is 6,000. We advise you to adjust your settings if it fails to fetch schema due to max number of tables reached.