> ## 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.

# Find and replace

> Replace text or regular-expression matches in Google Sheets.

`findAndReplace` searches a structured range, one sheet, or the whole
spreadsheet and replaces every match.

## Example

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

export default automation("Normalize status text", () => {
  onHttpRequest({ scope: "automation" })

  findAndReplace({
    spreadsheet: "spreadsheet-id",
    sheet: "Orders",
    find: "^pending$",
    replacement: "Open",
    searchByRegex: true,
    matchCase: false,
    matchEntireCell: true,
  })
})
```

## Inputs

`spreadsheet`, non-empty `find`, and `replacement` are required. Supply either
`sheet` (title or numeric ID) or structured `range`, not both; omit both for all
sheets. A range uses `sheet` and optional one-based inclusive row/column bounds.
`includeFormulas`, `matchCase`, `matchEntireCell`, and `searchByRegex` all
default false. Regex syntax is Java-compatible and replacement can use
supported capture references. `account` selects the Google account.

## Output

Returns counts for `occurrencesChanged`, `rowsChanged`, `sheetsChanged`,
`valuesChanged`, and `formulasChanged`. Zero occurrences is a successful no-op.
