Google Sheets Block

This integration allows you to read or write data from a Google Sheets spreadsheet.

Granting Access to the Spreadsheet

Before using this integration, you need to give access to the GoLess service. You can do this in two ways:

  1. Share the spreadsheet publicly, but note that GoLess will only have read access.

  2. Share the spreadsheet with the GoLess service account by clicking the share button on the top right of the spreadsheet and entering [email protected].\

Spreadsheet ID

The Spreadsheet ID is a string of letters, numbers, hyphens, or underscores. You can find it in the Google Sheets URL.

https://docs.google.com/spreadsheets/d/1CyccvSsq0VdujNThPKr3l8ipLQfQo9KuzTpJxpwTPyg/edit#gid=0

Cell Range

The cell range is the range of the cells that you want to get or update. You can define the range using either the A1 notation like Sheet1!A1:B2 or R1C1 notation like Sheet1!R1C1:R2C2.

Reading Spreadsheet Values

You can get the values of the cells in the spreadsheet.

  • Reference key The key for identifying the Google Sheets data.

  • Use the first row as keys Use the first row of the spreadsheet as the object key. For example, if you have a spreadsheet like this:

nameage

foo

22

bar

23

// option disabled
[["name", "age"], ["foo", 22], ["bar", 23]]

// option enabled
[{ "name": "foo", "age": 22 }, { "name": "bar", "age": 23 }]

Accessing Spreadsheet Data

To access the spreadsheet values from an input of a block, you can use expressions like {{ googleSheets.referenceKey.path }} syntax.

Read more: Expressions

Updating Spreadsheet Values

You can update the values of the cells in the spreadsheet.

  • Value input option Determines how input data should be interpreted, defaulting to RAW.

ValueDescription

RAW

The values the user has entered will not be parsed and will be stored as-is

USER_ENTERED

The values will be parsed as if the user typed them into the UI. Numbers will stay as numbers, but strings may be converted to numbers, dates, etc. following the same rules that are applied when entering text into a cell via the Google Sheets UI.

Read more on the Google developer page

  • Data source The source of the data for updating the spreadsheet defaults to a table. When using the custom option, the input data must be an array of arrays with valid JSON syntax.

Example

[["name", "age"], ["foo", 22], ["bar", 23, "text"]]
  • Use keys as the first row Use the columns as the first row on the spreadsheet.

Last updated