docs_batch_replace
Apply multiple find-and-replace operations in a single atomic batch, ensuring all changes succeed or none do.
Instructions
Apply multiple find→replace operations atomically in a single batchUpdate.
All replacements are applied in one API call (end-of-document first to preserve index validity). Either ALL changes succeed, or none do.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | Google Doc ID | |
| replacements_json | Yes | JSON array of replacements, e.g.: '[{"find": "Q1", "replace": "Q2"}, {"find": "draft", "replace": "final", "occurrence": 0}]' Each item: {"find": str, "replace": str, "occurrence": int (default 1, 0=all), "regex": bool (default false)} |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |