Google Sheets
Learn more about each capsule of the Google Sheets collection.
To access the Google Sheets collection and use the features presented in this article, you need the permission PIPELINE:CREATE. Learn more in the documentation about Roles.
The goal of Google Sheets collection is to read data and write information in your Google Sheet.
Requirements for using the Google Sheets collection
Activation of the Google Sheet API service
To use the Google Sheet services, you need to activate the Google Sheets API resource in your GCP (Google Cloud Platform) Console . Learn more about Enabling and Disabling Services.
Authentication
You must have a Digibee account of google-key type. If you don’t have it yet, go to the Service Accounts in your GCP Console and create a new key. More information at Create and delete service account keys.
Sharing
The previously created service account has a service account email. Use the address to share the sheet in edition mode to receive the data.
Errors handling
All capsules have standard responses. Whenever a request is successfully processed, the boolean field "success" is returned in the JSON root. Use this information to handle errors in your pipeline.
Google Sheets capsules
Get Spreadsheets By Id
The Get Spreadsheets By Id capsule allows you to check metadata in a Google Sheet.
Example:
URL: address to access through the browser
Sheets: list of pages that exist within the sheet
Title: name of the sheet
Get Rows Values by Range
The Get Rows Values By Range capsule can read data from the Google Sheet. It’s necessary to specify the name of the page, the column range, and the parameters to control pagination.
Example:
To read data in columns A, B, C, D, E, F, G, H, I, J, K, L from row 1 to row 100, these should be the parameters:
First Column: A
Last Column: L
Start Row: 1
Limit Row: 100
Append Data
The Append Data capsule makes it easier to record data in your Google Sheet, as it can record a single row or a list.
You must specify the name of the page where you want the data to be recorded. If you don't specify anything, the recording will be done on the first page found.
It's not necessary to specify the column range. However, it's necessary to specify from which column and row the data should be written. The values are always added after the last row.
Example:
Array provided to capsule by Double Braces expressions.
![](https://docs.digibee.com/~gitbook/image?url=https%3A%2F%2F2041393763-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F4523BaA7JfghHEYBbLWY%252Fuploads%252Focxo8SJrzrDgpSftlwJJ%252Fgoogle-sheets-image-1.png%3Falt%3Dmedia%26token%3D0049911c-2c73-4eac-9197-f91d590fb1b9&width=768&dpr=4&quality=100&sign=95cb52ed&sv=1)
The Append Data capsule has characteristics that prevent writing data on the same page of your sheet. If written at the same time, the data can be overwritten by the requests. Don’t use it in flows that allow parallelism.
The JSON data is converted to columns based on the order of the attributes sent, not the naming. If you need to reorder the fields, use one of our transformation components, such as the Transformer (JOLT).
See the following example:
Last updated