Replace Text
google_docs.replace_text
ActionFiles & storageconnection required
Calls documents.batchUpdate replaceAllText once per placeholder and reports how many occurrences each one changed.
Replace placeholder text throughout a Google Doc (template merge).
Connection
- Required
- Yes — the node will not save without one
- Auth type
- OAuth 2.0
- Providers
- Google Docs
- Secret shape
- {"client_id", "client_secret", "refresh_token"}
- Config it needs
- token_uri
- Resolved by
- config.connection_id, else node.connection_id
Configuration
6 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
document_id Id of the document (the long segment in its /document/d/<id>/edit URL). | string | Yes | — | — | — |
replacements Placeholder → value, e.g. {"{{name}}": "{{ $json.name }}"}. | object | No | — | — | — |
find Single placeholder, instead of 'replacements'. | string | No | — | — | — |
replace Value for 'find'. | string | No | — | — | — |
match_case Match the placeholder case-sensitively. | boolean | No | true | — | — |
require_match Fail the step when a placeholder matched nothing, instead of shipping a document that still shows it. | boolean | No | true | — | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"match_case": true,
"require_match": true
}Output
One shape.
merged
| Field | Type | Example |
|---|---|---|
ok | boolean | true |
document_id | string | — |
occurrences_changed Total across every replacement. | number | — |
replacements[].find | string | — |
replacements[].replace | string | — |
replacements[].occurrences_changed | number | — |
unmatched Placeholders that matched nothing. | array | — |
url Editor URL of the document. | string | — |
{
"document_id": "",
"occurrences_changed": 0,
"ok": true,
"replacements": [
{
"find": "",
"occurrences_changed": 0,
"replace": ""
}
],
"unmatched": [],
"url": ""
}Related Google Docs nodes
See Replace Text run in a workflow.
In a technical demo we add the Google Docs connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.