Skip to main content

Replace text in Google Doc

Replace every occurrence of one or more texts in a Google Docs document, such as placeholders in a template.

Command in the Google Workspace toolkit · id ooa.google/docs_replace_text · 5 inputs (3 required), 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
Access tokenCredentialYesGoogle OAuth access token from the vault; or leave it empty and choose a connection that signs in, which gets and renews the token.
Document IDStringYesThe document: its id, or its full link (https://docs.google.com/document/d/...).
ReplacementsDictionaryYesText to find as each key, and the text to put in its place as the value.
Match caseBooleanNofalseOnly replace text with the same upper and lower case.
Endpoint addressStringNoReplaces https://*.googleapis.com for testing or a proxy; leave empty normally.

Outputs​

OutputTypeWhat it is
occurrences_changedNumberTotal number of places changed.