Skip to content

Google Sheets: Add sheet

Adds a sheet (a tab) to an existing spreadsheet.

  • One sheet per month, per team or per import, in a spreadsheet that already exists.

A sheet of that name already there fails the step with Google’s reason, and that includes a step run again after its sheet was added. To add one only when it is missing, check with get_spreadsheet first.

Field Required Description
spreadsheet_id yes The id in the spreadsheet’s address: docs.google.com/spreadsheets/d/<id>/edit. For example: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms.
Field Type Required Description
title string yes The new sheet’s name. A sheet of that name already there fails the step with Google’s reason.
row_count integer no How many rows its grid starts with. Default 1000.
column_count integer no How many columns its grid starts with. Default 26.

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]).

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.replies array of object One reply, whose addSheet.properties holds the new sheet’s sheetId, title and index: replies[0].addSheet.properties.sheetId.
body.replies[].addSheet object
body.replies[].addSheet.properties object
body.spreadsheetId string
  • On an agent with the connector capability. The managed environments have one, so this needs no agent of your own.
  • One POST request to sheets.googleapis.com.
  • Any 4xx or 5xx fails the step, unless fail_on_error_status is false. retry: asks again after a 5xx, a 401, 408, 409, 423, 425 or 429, or a 4xx with Retry-After, and not after any other 4xx, which would get the same answer.
  • 429 waited out and asked again with backoff, with no retry: on the step.
version: hyperspool-graph/v1
nodes:
- id: add
type: google-sheets.add_sheet
config:
credential: sheets
with: { spreadsheet_id: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms }
input:
title: { $expr: "input.month" }
row_count: 500
column_count: 8
- id: header
type: google-sheets.update_range
config:
credential: sheets
with: { spreadsheet_id: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms }
input:
range: { $template: "'{{ input.month }}'!A1" }
values: [[date, region, orders]]
edges:
- { from: add, to: header }

The new sheet’s id is at nodes.<id>.output.body.replies[0].addSheet.properties.sheetId.

See Connectors for credentials and versions, and the node reference for every other node.