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.

FieldTypeRequiredDefaultConstraintsExample
document_id
Id of the document (the long segment in its /document/d/<id>/edit URL).
stringYes———
replacements
Placeholder → value, e.g. {"{{name}}": "{{ $json.name }}"}.
objectNo———
find
Single placeholder, instead of 'replacements'.
stringNo———
replace
Value for 'find'.
stringNo———
match_case
Match the placeholder case-sensitively.
booleanNotrue——
require_match
Fail the step when a placeholder matched nothing, instead of shipping a document that still shows it.
booleanNotrue——

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

FieldTypeExample
ok
booleantrue
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": ""
}

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.