Google Docs

App · Documents · 7 actions · 1 trigger

Create and edit documents in Google Docs.

Triggers

Start a workflow when something happens in Google Docs. See how triggers work.

Google Docs Document Modified

Triggers when a Google Docs document is modified

Filters

Narrow which events start a run.

document_idRequired

Event fields

What a run starts with. Later steps read each field with an @ reference.

document_idtext
titletext
revision_idtext

Actions

ActionWhat it does
Add bulleted listAdd a bulleted list at the end of a Google Docs document.
Append textAppend text to the end of a Google Docs document.
Clear documentClear all content from a Google Docs document.
Create documentCreate a new Google Docs document with a given title.
Get document textRetrieve the plain text content of a Google Docs document.
Insert headingInsert a heading at the end of a Google Docs document.
Replace textReplace all occurrences of a word or phrase in a Google Docs document.

Add bulleted list

Add a bulleted list at the end of a Google Docs document.

Inputs

Document IDdocument_idtextRequired
The ID of the document
ItemsitemslistRequired
The lines of text to add as bullet points

Outputs

Bulleted-list insertion result

rangeobject
Start and end indexes of the inserted list
Example output
{
  "range": {
    "end": 120,
    "start": 70
  }
}

Append text

Append text to the end of a Google Docs document.

Inputs

Document IDdocument_idtextRequired
The ID of the document
TexttexttextRequired
Text to append to the document

Outputs

Append result

inserted_atnumber
Index where the text was inserted
Example output
{
  "inserted_at": 42
}

Clear document

Clear all content from a Google Docs document.

Inputs

Document IDdocument_idtextRequired
The ID of the document to clear

Outputs

No return value

Create document

Create a new Google Docs document with a given title.

Inputs

TitletitletextRequired
Title of the new document

Outputs

Created Google Docs document

document_idtext
Document ID of the created document
Example output
{
  "document_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
}

Get document text

Retrieve the plain text content of a Google Docs document.

Inputs

Document IDdocument_idtextRequired
The ID of the document

Outputs

Plain text content of the document

texttext
Plain text content of the document
Example output
{
  "text": "This is the document content.\n\nIt has multiple paragraphs."
}

Insert heading

Insert a heading at the end of a Google Docs document.

Inputs

Document IDdocument_idtextRequired
The ID of the document
Heading textheading_texttextRequired
Text for the heading
Levelleveltext
Heading size, from largest to smallest: HEADING_1, HEADING_2, HEADING_3, or HEADING_4

Outputs

Heading insertion result

rangeobject
Start and end indexes of the inserted heading
Example output
{
  "range": {
    "end": 65,
    "start": 50
  }
}

Replace text

Replace all occurrences of a word or phrase in a Google Docs document.

Inputs

Document IDdocument_idtextRequired
The ID of the document
Find textfind_texttextRequired
Text to find in the document
Replace textreplace_texttextRequired
Text to replace with

Outputs

Replacement result

occurrences_changednumber
Number of occurrences replaced
Example output
{
  "occurrences_changed": 3
}

On this page