SCALIX help

← All tools

sheets_append_rows

Google Sheets write medium risk

Part of the Google Sheets Agent.

What it does

Appends rows after the existing data table in a sheet (spreadsheets.values.append). Use this for accumulating logs or adding new report rows without overwriting prior content. The API auto-detects the last contiguous table within the given `range` and writes starting at the first column of the next empty row. Key inputs: `spreadsheet_id`, `range` used as a table-search anchor (e.g. 'Performance!A1' or 'Performance!A:F'), `values` (2D array of new rows), `value_input_option` ('USER_ENTERED' or 'RAW'), and `insert_data_option` ('INSERT_ROWS' (default; pushes existing content down, non-destructive) or 'OVERWRITE' to fill the cells directly after the table). Returns Google's `tableRange` (the detected table) and an `updates` object with `updatedRange`, `updatedRows` and `updatedCells`. Gaps (fully empty rows) break table continuity; empty cells within rows do not. Response shape: success {success:true,data:{applied,result}} where result is Google's {spreadsheetId,tableRange,updates:{updatedRange,updatedRows,updatedColumns,updatedCells}}; error {success:false,error_class,message,action_required,is_retryable}. Two-phase (ADR-028/029, the same gate as Google Ads, LinkedIn and CRM writes): the first call (no preview_id) builds the request locally and returns a preview_id - nothing is created or written; re-call with that preview_id and identical arguments to COMMIT (single-use, 30 min; a changed, forged or replayed token fails closed).

When to use it

Use to add new rows to an existing client report/log without disturbing prior rows (e.g. daily metric snapshots, or forwarding the client's own consented leads). For exact in-place placement or replacing a fixed block, use sheets_write_values. To write a report's rows into a new or existing file in one call (no formatting), use sheets_export_report.

Inputs

NameTypeRequiredDescription
spreadsheet_idstringyesTarget spreadsheet ID.
rangestringyesA1 range used to locate the table to append to, e.g. 'Performance!A1' or 'Performance!A:F'. Append starts after the last row of the detected table. Anchor on a column range for predictability.
valuesarray<array<string|number|boolean>>yes2D array of rows to append (each inner array is a row). Cells are text, numbers, true/false or null - never objects.
value_input_optionstringno'USER_ENTERED' (parse like the UI - recommended) or 'RAW'. Default 'USER_ENTERED'.
insert_data_optionstringno'INSERT_ROWS' (default - inserts new rows, pushing existing content down; non-destructive) or 'OVERWRITE' (writes into the cells immediately after the detected table and can clobber them).
major_dimensionstringno'ROWS' (default) or 'COLUMNS'.
preview_idstringnoOmit it to preview: nothing is applied, and the call returns a preview_id bound to this exact request. Pass it only after the user approves that preview in a later message, with the same arguments (leave out validate_only, and add any confirmation flag the preview names). Single-use, expires in 30 minutes; changed arguments need a fresh preview.

Safeguards

A change in two steps. The first call previews and changes nothing; Claude shows you the preview and applies it only after you approve, within 30 minutes and with the same arguments. Every applied change goes to the audit log. How changes are approved.

Policy

Append only the authorizing client's own data to the client's own spreadsheet; confirm the destination before appending. White-label content only (no Claude/MCP/Anthropic/Scalix-internal labels). Strict per-account isolation. Data-usage: never append LinkedIn member-derived data; member/lead data may be used ONLY for the authorizing client and ONLY for consented purposes - never to enrich/append/verify profiles, build a cross-account or unaffiliated lead database, do prospecting, or commingle data across clients. Forward only the client's OWN leads, with consent, and hash PII where the destination supports it. Honor deletion on request; member profile data caches <=24h, social activity <=48h.

Reminder

Append auto-detects the table tail - verify spreadsheet_id and target tab so rows land where the client expects.

Errors

Error classMeansWhat to doRetry
auth_errorMissing or expired Google token, invalid session, or ungranted scope (401).Reconnect Google in the Scalix dashboard (the connection requests the spreadsheets scope), then retry.no
permission_errorAccount lacks edit access to the spreadsheet (403).Confirm client edit rights to this file; fix before retrying.no
not_found_errorspreadsheet_id or sheet/tab named in the range not found (404).Verify the spreadsheet_id and tab name in the range; do not retry blindly.no
rate_limit_errorSheets write quota exceeded (429): 60/min/user, 300/min/project.Retry with truncated exponential backoff min((2^n + random_ms), 64s).yes
validation_errorMalformed range or ragged/invalid values (400), e.g. unparseable A1 anchor or bad insertDataOption. Surface the Google message verbatim.Fix the range/values per the platform message and retry.no
outcome_unknownGoogle Sheets answered a 5xx (e.g. 500/503) to this write, or the connection timed out or dropped once it was open, so the write may have landed.Check first: read the range back with sheets_get_values (a second append adds the rows twice), and start over with a fresh preview only if the rows are not there.no

Edge cases

  • Table detection: append finds the LAST contiguous table in the range; a blank row creates a gap and changes where data lands - anchor on a column range like 'A:F' for predictability.
  • OVERWRITE can clobber non-empty cells directly below the detected table; the default INSERT_ROWS is non-destructive.
  • Idempotent upsert / dedupe: append is NOT idempotent - retrying after an ambiguous timeout can duplicate rows. Dedupe by a stable key (e.g. date+account, or lead id) by reading existing rows (sheets_get_values) before appending, or check tableRange before retrying.
  • Partial batch: a single append call is atomic for its rows - there is no per-row partial success; the whole ValueRange applies or the call errors.
  • Empty values [] appends nothing (updatedRows=0).
  • Pagination/large appends: chunk very large batches to stay under the ~2MB payload guidance and the 10M-cell workbook ceiling.
  • Retention/consent: never append LinkedIn member-derived data; forward only the client's own consented leads; do not write transient member-sourced fields at all (respect 24h/48h purge).