Google Sheets: Get spreadsheet details
Returns a spreadsheet’s title, locale and time zone, and each sheet’s properties: its title, id, position and size.
- Kind:
google-sheets.get_spreadsheet - Palette: Integrations, under Google Sheets
- Credential: a credential of kind
bearer, named incredential - Other Google Sheets actions: Read rows as objects, Append rows, Update or append a row by key, Read range, Update range, Clear range, Create spreadsheet, Add sheet
When to use
Section titled “When to use”- Finding out which sheets exist before reading or adding one.
- Looking up a sheet’s numeric
sheetId, which some Sheets API requests need.
Connection (with)
Section titled “Connection (with)”| Field | Required | Description |
|---|---|---|
spreadsheet_id |
yes | The id in the spreadsheet’s address: docs.google.com/spreadsheets/d/<id>/edit. For example: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms. |
Input (input)
Section titled “Input (input)”This action takes no input.
Settings
Section titled “Settings”Beside with and input in the node’s config.
| Field | Type | Required | Description |
|---|---|---|---|
credential |
string | yes | Name of the project credential the action authenticates with. |
fail_on_error_status |
boolean | no | Treat any 4xx/5xx as a failure. On by default: an action either did its job or did not. Default true. |
optional_when_untrusted |
boolean | no | Run without the credential when the run is untrusted (a fork pull request), instead of failing. The credential is still withheld. |
retry_on |
array | no | Status codes that fail the node instead of returning, so its retry: policy applies (e.g. [429, 503]). |
Output
Section titled “Output”The HTTP response. The reply is under body: nodes.<id>.output.body.<field>.
| Field | Type | Description |
|---|---|---|
status |
integer | The HTTP status code. |
headers |
object | The response headers. |
body |
object | The response body, parsed as JSON when it is JSON. |
body.properties |
object | |
body.properties.locale |
string | |
body.properties.timeZone |
string | |
body.properties.title |
string | |
body.sheets |
array | One entry per sheet, each with properties.title, properties.sheetId and properties.gridProperties. |
body.spreadsheetId |
string |
How it runs
Section titled “How it runs”- On an agent with the
connectorcapability. The managed environments have one, so this needs no agent of your own. - One
GETrequest tosheets.googleapis.com. - Any 4xx or 5xx fails the step, unless
fail_on_error_statusisfalse.retry:asks again after a 5xx, a 401, 408, 409, 423, 425 or 429, or a 4xx withRetry-After, and not after any other 4xx, which would get the same answer. 429waited out and asked again with backoff, with noretry:on the step.
Example
Section titled “Example”version: hyperspool-graph/v1nodes: - id: info type: google-sheets.get_spreadsheet config: credential: sheets with: { spreadsheet_id: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms } - id: add_month type: google-sheets.add_sheet if: "!nodes.info.output.body.sheets.exists(s, s.properties.title == input.month)" config: credential: sheets with: { spreadsheet_id: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms } input: title: { $expr: "input.month" }edges: - { from: info, to: add_month }Adding a sheet whose name is taken fails the step, so this graph checks first and adds the month’s sheet only when it is missing.
See Connectors for credentials and versions, and the node reference for every other node.