Skip to content

sheets.updateRecords — update Sheet rows by key column match #55

@AojdevStudio

Description

@AojdevStudio

Summary

Implement sheets.updateRecords operation that updates rows in a Google Sheet by matching a key column value. Enables writing tracking/status data back to the contact sheet after campaign execution.

Context

  • Repository: ~/Projects/local-mcps/gdrive
  • GitHub: AojdevStudio/gdrive
  • Plan Doc: docs/plans/2026-03-10-email-outreach-features.md (Task 8)
  • Relevant Files: src/modules/sheets/update.ts (new or extend existing), src/sdk/spec.ts, src/sdk/runtime.ts
  • Related Issues: Related to sheets.readAsRecords (uses same keyed-object pattern)

Current Behavior

sheets.updateCells requires explicit cell ranges (e.g., A2:C2). No way to update rows by matching a column value.

Expected Behavior

sheets.updateRecords accepts a spreadsheetId, sheet name, key column name, and an array of update objects { key: string, updates: Record<string, string> }. It reads the sheet, finds rows where the key column matches, and updates the specified columns in those rows.

Acceptance Criteria (max 3)

  • AC-1: Matches rows by key column value and updates only the specified columns in matched rows
  • AC-2: Returns a result summary: { updated: number, notFound: string[], errors: string[] }
  • AC-3: Does not modify rows that do not match any provided key value

Scope

In scope: updateRecords operation, key-column matching logic, SDK spec + runtime, unit tests
Out of scope: Upsert (insert if not found), multi-column key matching, formula preservation

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions