Google Docs

The Google Docs modules enable you to monitor, create, edit and retrieve documents in your Google Docs and Google Shared Drive (for G Suite users).

Getting Started with Google Docs

Prerequisites

  • A Google account
  • A G Suite account (only if you need to process documents in Google Shared Drive)

In order to use Google Docs with Integromat, it is necessary to have a Google account. If you do not have one, you can create a Google account at google.com.

The module dialog fields that are displayed in bold (in the Integromat scenario, not in this documentation article) are mandatory!

Connecting Google Docs to Integromat

To connect your Google Docs account to Integromat follow the general instructions for Connecting to services.

After you click the Continue button, Integromat will redirect you to the Google Docs website where you will be prompted to grant Integromat access to your account.

2020-02-25_19_29_38-Sign_in_-_Google_Accounts.png

Confirm the dialog by clicking the Allow button.

Document

Watch Documents

Returns document details when a new document is created or modified in the selected folder.

Connection Establish a connection to your Google account.
Watch Documents Select whether you want to watch created (By Created Date) or modified (By Modified Date) documents.
Choose a Drive

Select what type of drive you want to monitor.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
Folder ID / Shared Drive

Select the folder you want to watch for created or modified documents.

If you have selected the Google Shared Drive option in the field above and you are not a G Suite user, the error [400] Invalid Value is returned.
Limit Set the maximum number of documents Integromat will return in one execution cycle.

List Documents

Retrieves a list of documents from the selected folder.

Connection Establish a connection to your Google account.
Watch Documents Select whether you want to watch created (By Created Date) or modified (By Modified Date) documents.
Choose a Drive

Select the drive you want to retrieve documents from.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
Folder ID / Shared Drive

Select the folder you want to watch for created or modified documents.

If you have selected the Google Shared Drive option in the field above and you are not a G Suite user, the error [400] Invalid Value is returned.

Get Content of a Document

Retrieves a specified document.

You may need to extend your permissions.

2020-02-18_14_02_21-Integration_Google_Docs___Integromat.png
Connection Establish a connection to your Google account.
Get Content of a Document Select whether you want to map the document ID of the document or select the document from the drop-down menu manually.
Document ID Select or map the document you want to retrieve.
Choose a Drive

Select the drive you want to retrieve the document from.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
Filter

Select the object you want to be returned in the module's output. 

  • Image (default)
  • Drawing
  • Chart
For further mapping of these objects, please use Inline Objects Array (instead of inlineObjects).
The Inline Objects Array objects are sorted in the same order they appear in the document. It will make any further processing easier.

Create a Document

Allows you to create a new document in the selected folder.

Connection Establish a connection to your Google account.
Name Enter the name of the document.
Content Enter the content of the document. HTML is supported.
Choose a Drive

Select the drive where you want to create the document.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
New Document's Location Select the folder where you want to save the document.
Insert Header Enable this option to insert the header to the document.
Insert Footer Enable this option to insert the footer to the document.

Create a Document From a Template

Creates a new document from the template document where the mustache variables ({{}}) are used.

Connection Establish a connection to your Google account.
Create a Document from a Template
  • By Mapping - select this option to map the document template.
  • By Dropdown - select this option to choose the document template from the drop-down menu.
Document ID Select or map (based on the option selected above) the document with the variables  ({{}}) you want to use as the template for the new document.
Values

Enter the values that will be entered instead of the variables to the new document.

Tags Enter the tags that are contained in the document template. Do not use {{}}.
Replaced Value Enter the value of the tag.

E.g. {{name}} variable in the source document will be displayed as the name field here, where the value can be inserted, for example, John.

Images Replacement

Enter the link to the Image Object ID (You can retrieve the image IDs by using Get a Document module, where the IDs are contained in the array Inline Object Array) and Image URL that will replace the current image.

We recommend that you add ALT text to images in your Google document. The module will more easily recognize them.

Adding an ALT Text to the Google Docs image

1. Right click on the image.

2. Select the ALT text option.

3. Enter the ALT text in the Title field and click OK.

r40X72egsw.gif

After the ALT text is added to the image, the ALT text is displayed in the field name in round brackets:

2020-02-24_14_15_04-Integration_Google_Docs___Integromat.png

Title Enter the name for the new document.
New Drive Location

Select the drive where you want to create the document.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
New Document's Location Select or map the folder where you want the document to be created.

 

Insert a Paragraph to a Document

Appends or inserts a new text to an existing document.

Connection Establish a connection to your Google account.
Select a Document
  • By Mapping - select this option to map the document template.
  • By Dropdown - select this option to choose the document from the drop-down menu.
Choose a Drive

Select the drive that contains the document you want to insert a paragraph to.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
Document ID Select or map the document you want to edit.
Insert a Paragraph

Select how you want the new text to be inserted in the document.

  • By specification of location
    By index

    Index
    Enter the Index number where you would like to insert your text. The Get a Document module can be used to retrieve that number.

    2020-02-19_14_18_49-Integration_Google_Docs___Integromat.png

    To display all characters (including hidden) in the document, you can use the Show add-on. You can find the add-on under Add-ons > Get add-ons > search for Show and install the Show add-on.
    K7gwYCWyGZ.gif

    Inserted text
    Enter the text you want to insert to the document.

    By segment ID

    Select the header and footer you want to insert the text content to and enter the text you want to insert to the corresponding fields.

    If the header and/or footer already contains text, the new text will be added before the existing one.

  • By appending to the body of the document
    Appends entered text in the document's body content.
    The style of the new paragraph will be copied from the paragraph at the current insertion index, including lists and bullets.
  • By appending to the end of segment (Header and Footer)

    Select the header and footer you want to insert the text content to and enter the text you want to insert to the corresponding fields.

    If the header and/or footer already contain a text, the new text will be added after the existing one.

Insert an Image to a Document

Inserts an image from the URL to the document.

Connection Establish a connection to your Google account.
Select a Document
  • By Mapping - select this option to map the document template.
  • By Dropdown - select this option to choose the document from the drop-down menu.
Choose a Drive

Select the drive that contains the document you want to insert an image to.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
Document ID Select or map the document you want to add an image to.
Insert an Image

Select how you want the new text to be inserted in the document.

  • By specification of location
    By index

    Index
    Enter the Index number where you would like to insert the image. The Get a Document module can be used to retrieve that number.

    2020-02-19_14_18_49-Integration_Google_Docs___Integromat.png

    Image URL
    Enter the URL of the image you want to insert into the document.

    The maximum image size is 50 MB. Must not exceed 25 megapixels. Only PNG, JPEG or GIF format is supported.
    By segment ID

    Select the header and footer you want to insert an image to and enter the image URL to the corresponding fields.

    The maximum image size is 50 MB. Must not exceed 25 megapixels. Only PNG, JPEG or GIF format is supported.

  • By appending to the body of the document
    Appends a specified image in the body content of the document.
     
  • By appending to the end of segment (Header and Footer)

    Select the header and footer you want to insert an image to and enter the image URL you want to insert to the corresponding fields.

Height Magnitude in Points/Width Magnitude in Points

Define the size of the inserted image. The aspect ratio will be kept.

Replace an Image with a New Image

Replaces an existing image. The aspect ratio of the original image will be maintained.

Connection Establish a connection to your Google account.
Replace an Image
  • By Mapping - select this option to map the target document and image to be replaced.
  • By Dropdown - select this option to choose the document from the drop-down menu.
Choose a Drive

Select the drive that contains the document that you want to replace an image for.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
Document ID Select or map the document that contains the image(s) you want to replace.
Image URLs

Body: Image No. 1
(Location: Order of the existing image in the document)

Enter the URL of the new image that will replace the existing one.

Images Replacement

Add the images that you want to replace.

Image Object ID
Map the Object ID of the image. It can be retrieved using the Get a Document module (Inline Objects Array):
2020-02-26_15_46_54-Integration_Google_Docs___Integromat.png

Image URL
Enter the URL of the new image.
The Example

2020-02-20_12_19_13-Integration_Google_Docs___Integromat.png

Replace a Text in a Document

Finds a specified text and replaces it with the new one.

Connection Establish a connection to your Google account.
Choose a Drive

Select the drive that contains the document that you want to replace a text of.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
Document ID Select or map the document that contains the text you want to replace.
Replace a Text

Finds and replaces a text within the document.

  • Old text to be replaced
    Enter the text you want to replace.
  • New text to be inserted
    Enter the new text.

Download a Document

Converts and downloads the selected document.

Connection Establish a connection to your Google account.
Choose a Drive

Select the drive that contains the document you want to download.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
Document ID Select or map the document that contains the text you want to replace.
Type Select the target file format of the downloaded document.

Delete a Document

Deletes a document.

Connection Establish a connection to your Google account.
Choose a Drive

Select the drive that contains the document you want to delete.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
Document ID Select or map the document you want to delete.

Make an API Call

Allows you to perform a custom API call.

Connection Establish a connection to your Google account.
URL

Enter a path relative to https://docs.googleapis.com/. E.g./v1/documents/{DocumentID}

For the list of available endpoints, refer to the Google Docs API Documentation.
Method

Select the HTTP method you want to use:

GET
to retrieve information for an entry.

POST
to create a new entry.

PUT
to update/replace an existing entry.

PATCH
to make a partial entry update.

DELETE
to delete an entry.

Headers Enter the desired request headers. You don't have to add authorization headers; we already did that for you.
Query String Enter the request query string.
Body Enter the body content for your API call.

Example of Use - Get a Document

The following API call retrieves the details for the specified document in your Google Docs:

URL:
/v1/documents/1ujkf-GDgB0TQSYPrxbCSK4Uso54tHVMqHZEVZZxB6aY

Method:

GET


2020-02-21_11_06_52-Integration_Google_Docs___Integromat.png

Details of the retrieved document can be found in the module's Output under Bundle > Body

2020-02-21_11_10_01-Integration_Google_Docs___Integromat.png

Make All Links in a Document Clickable

Finds all links in the document and makes them clickable.

Connection Establish a connection to your Google account.
Make All Links in a Document
  • By Mapping - select this option to map the target document.
  • By Dropdown - select this option to choose the document from the drop-down menu.
Choose a Drive

Select the drive that contains the document you want to update the links in.

  • My Drive
  • Shared With Me
  • Google Shared Drive (available for G Suite users only!)
Document ID Select or map the document you want to update the links in.

Popular use cases from our blog

slack-automation-illustration

Slack Automation: 20 Free Templates to Get You Inspired

google-sheets-automation-alt

Google Sheets Automation for Ecommerce: 23 Free Templates

tweet-automation-illustration

How to Get Someone's Tweets Before Anyone Else Does

onboarding-automation-with-integromat-alt

How to Automate Employee Onboarding in Minutes with Integromat

shopify-order-to-manufacturer-illustration-alt

How to Auto Send Shopify Orders to Dropshipping Suppliers [Guide]

strava-exercise-to-google-sheets-illustration

Like a Champ: How to Save Strava Activities to Google Sheets

Didn’t find what you were looking for?

Ticket

Create a ticket

Contact our world-class support team and tell us what’s happening.

Create a ticket
Expert

Find an expert

We feature a network of 450+ certified partners across the globe who are ready to help

Find an expert

Automate any workflow in your business

Sign up for a free account today. No credit card required, no time limits on free plan.