> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Update rows

> Apply partial header-keyed updates to explicitly numbered Google Sheets rows.

`updateRows` writes only the supplied cells and preserves other columns.

## Example

```ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { updateRows } from "automate.ax/google-sheets"

export default automation("Close processed orders", () => {
  onHttpRequest({ scope: "automation" })

  updateRows({
    spreadsheet: "spreadsheet-id",
    source: { table: "OrdersTable" },
    updates: [
      { rowNumber: 12, values: { Status: "Closed" } },
      { rowNumber: 18, values: { Status: "Closed", Total: null } },
    ],
  })
})
```

## Inputs

`spreadsheet`, `source`, and non-empty `updates` are required. Each update has a
one-based `rowNumber` and non-empty `values` record whose keys exactly match
headers. `null` clears a cell. `inputMode` defaults to `userEntered`; `account`
selects the Google account.

## Output

Returns `{ affectedCells, rowNumbers }`. `affectedCells` counts supplied cells,
not the full row width. Duplicate row numbers are accepted and remain in output;
later writes to the same cell win in request order.
