Google Docs
Procedures and concepts for the Google Docs integration.
Overview
Google Docs provides collaborative document creation and editing with real-time synchronization across teams. This integration enables automated document generation, content management, and collaborative writing workflows. Enhance documentation processes and improve team collaboration on shared documents.
Prerequisites
1. Required Books
The following Book(s) need to be added to your agent so it can learn and understand the automation procedures defined within them:
Google Docs
How to Add the Book(s)
Go to Books → All Books.
Search for the name of the book and click on it.
Click on Install or Add Connection to add the book to your agent.
If adding a connection, you'll be prompted for connectivity details.
Connectivity
This section outlines the available methods for connecting to the Book, along with the required configuration details for each.
Connect using Client Email, Token URI and Private Key
Gets the credentials from the service account keys.
Client Email
The client email of the service account registered in the Google Cloud Console.
text
Token URI
The token URI of the Google Cloud Console.
text
Private Key
The private key of the service account registered in the Google Cloud Console.
sensitive
Procedures
to add a paragraph to a (document)
Add a new paragraph to the end of a document.
Input Concepts
text
The new paragraph text.
text
Yes
(no default)
style
Optional. The new paragraph's style.
enum[HEADING_1, HEADING_2, HEADING_3, NORMAL_TEXT, SUBTITLE, TITLE]
No
(no default)
Output Concepts
Examples
Add a heading to a document
to batch update document
Apply raw Google Docs batch update requests to a document.
Input Concepts
requests json
A JSON array of Google Docs batchUpdate requests.
text
Yes
(no default)
write control json
Optional. A JSON object with Google Docs writeControl settings.
text
No
(no default)
Output Concepts
Examples
Apply a raw batch update request
to create a google document in a (folder)
Creates a new Google Docs document.
Input Concepts
name
The name for the new Google Docs document.
text
Yes
(no default)
Output Concepts
Examples
Create a Google Docs document called "Hello World" in a folder
to find a (document text range) in a document
Find the index range of exact text in a document.
Input Concepts
text
The exact text to find.
text
Yes
(no default)
occurrence index
Optional. The zero-based occurrence to return when the text appears multiple times.
number
No
0
match case
Optional. Whether the match should be case sensitive.
boolean
No
True
Output Concepts
Examples
Find text in a document
to get a (document paragraph) from a document
Resolve the paragraph containing a document index.
Input Concepts
index
The document index contained in the paragraph.
number
Yes
(no default)
Output Concepts
Examples
Get the paragraph containing an index
to get a (document) from docs
Get the full Google Docs document.
Input Concepts
Output Concepts
Examples
Get the full document
to get some (document comments) from a document
Get comments and replies for a Google Docs document.
Input Concepts
The Google Docs document whose comments should be retrieved.
google drive file reference
Yes
(no default)
Output Concepts
Examples
Get the document comments
to get some (document tables) from a document
Extract the table structures and cell text from a document.
Input Concepts
Output Concepts
Examples
Get the document tables
to get some (document text blocks) from a document
Get the document paragraph text with document indexes.
Input Concepts
Output Concepts
Examples
Get the document text blocks
to insert a heading in a document
Insert a heading at the end of a document.
Input Concepts
text
The heading text.
text
Yes
(no default)
style
Optional. The heading style to apply.
enum[HEADING_1, HEADING_2, HEADING_3, NORMAL_TEXT, SUBTITLE, TITLE]
No
{'class_name': 'ParagraphStyle', 'name': 'HEADING_1', 'value': 'HEADING_1'}
Output Concepts
Examples
Insert a heading in a document
to overwrite a document
Replace the main body content of a document.
Input Concepts
content
The new document body text.
text
Yes
(no default)
Output Concepts
Examples
Overwrite a document
to replace text in a document
Replace exact text everywhere it appears in a document.
Input Concepts
old text
The exact text to replace.
text
Yes
(no default)
replacement text
The text that should replace the old text.
text
Yes
(no default)
Output Concepts
Examples
Replace placeholder text in a document
Concepts
Google drive file reference
Contains all information required to identify a file in Google Drive.
id
The id of the file
text
file_name
The name of the file
text
Google drive folder reference
Contains all information required to identify a folder in Google Drive.
id
The id of the folder
text
folder_name
The name of the folder
text
Google docs range
A range inside a Google document.
start_index
The inclusive start index in the document.
number
end_index
The exclusive end index in the document.
number
text
Optional text contained in the range.
optional[text]
Google docs document
A normalized Google document.
id
The document identifier.
text
title
The document title.
text
revision_id
Optional document revision identifier.
optional[text]
text
The flattened document text.
optional[text]
Google docs paragraph
A paragraph extracted from a Google document.
text
The paragraph text.
text
start_index
The inclusive start index in the document.
number
end_index
The exclusive end index in the document.
number
paragraph_style
Optional paragraph style name.
optional[text]
Google docs table
A table extracted from a Google document.
start_index
The table start index.
number
end_index
The table end index.
number
Google docs comment
A Google document comment.
id
The comment identifier.
text
author
The display name of the comment author.
optional[text]
content
The comment content.
optional[text]
created_time
When the comment was created.
optional[text]
modified_time
When the comment was last modified.
optional[text]
resolved
Whether the comment is resolved.
optional[boolean]
Google docs comment reply
A reply to a Google document comment.
id
The reply identifier.
text
author
The display name of the reply author.
optional[text]
content
The reply content.
optional[text]
created_time
When the reply was created.
optional[text]
modified_time
When the reply was last modified.
optional[text]
Google docs text block
A text block extracted from a Google document.
text
The text content.
text
start_index
The inclusive start index in the document.
number
end_index
The exclusive end index in the document.
number
paragraph_style
Optional paragraph style name.
optional[text]
Last updated
Was this helpful?

