integrations.google_sheets

Google Sheets (integrations.google_sheets)

Read, append, update, and look up rows — plus create whole spreadsheets. Spreadsheet, tab, and column pickers are live (fetched from your Drive and the sheet's header row); free-text ids work everywhere.

Operations

OperationWhat it does
append_rowAdds one row per input item, aligned to the header row via the column mapping.
update_rowUpdates every row where match_column equals match_value; only mapped cells are patched.
read_rowsEmits one item per row ({header: cell, row_number}).
lookupPer input item, emits the rows where lookup_column equals lookup_value.
create_spreadsheetCreates a new spreadsheet per item, returns its metadata (including spreadsheetId).

Credential: oauth2_google (spreadsheets scope).

Column mapping

Append/update write by header → value mapping: pick a column from the live header dropdown, map an expression to it. Unknown column names fail with a clear error listing what's available. Unmapped columns are left blank on append and untouched on update.

Header row

header_row (default 1) says which sheet row holds the column headers — for sheets with a title or banner above the real table, set it to the header's row number. Everything follows it: reads and lookups ignore the rows above and keep row_number as the real sheet row, append/update align and match against that row, and the live column dropdowns read it too. With an explicit read range, the row is counted from the top of that range.

Quirks & tips

  • spreadsheet_id and sheet accept expressions — items can fan out to different tabs in one run, and each tab's own header order is used for alignment and matching.
  • Row snapshots are per run: read/lookup/update-match fetch the table once per target tab and match every item against that snapshot — an update that changes the match column mid-run won't be re-read.
  • update_row with no matching row is an error (naming column and value), not a silent skip. Same for a lookup_column that isn't in the header row.
  • Ragged rows: cells missing at the end arrive as null; extra cells beyond the header row are dropped; duplicate header names collapse to one key (last cell wins). Keep headers unique.
  • row_number in read/lookup output is the real 1-based sheet row — handy to feed back into an update.
  • With first_row_headers off, rows arrive as {values: […], row_number} and lookup matches by column letter (B).
  • Values are written with USER_ENTERED — Sheets parses numbers/dates the way typing would.

Related

  • Google Drive — files rather than cells.
  • Extract From File — turn an uploaded csv/xlsx into the same row-item shape.
  • Loop — batch big writes.