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 G Suite account (only if you need to process documents in Google Shared Drive)

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

### Note

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

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

Confirm the dialog by clicking the Allow button.

## Document

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

Connection

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.

### Note

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 Make will return in one execution cycle.

Retrieves a list of documents from the selected folder.

Connection

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.

### Note

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.

Retrieves a specified document.

### Note

You may need to extend your permissions.

Connection

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

### Note

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.

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

 Connection 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 DriveShared With MeGoogle 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 into the document.

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

Connection

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 the 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.

1. Right-click on the image.

2. Select the ALT text option.

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

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

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.

Appends or inserts a new text to an existing document.

Connection

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.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.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.

### Note

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.

Inserts an image from the URL to the document.

Connection

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.

Image URL

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

### Note

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.

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

 Connection 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 DriveShared With MeGoogle 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 IDMap the Object ID of the image. It can be retrieved using the Get a Document module (Inline Objects Array):Image URLEnter the URL of the new image.The Example

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

 Connection Choose a Drive Select the drive that contains the document that you want to replace a text of.My DriveShared With MeGoogle 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 replacedEnter the text you want to replace.New text to be insertedEnter the new text.

 Connection Choose a Drive Select the drive that contains the document you want to download.My DriveShared With MeGoogle 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.

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 DriveShared With MeGoogle 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 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:GETto retrieve information for an entry.POSTto create a new entry.PUTto update/replace an existing entry.PATCHto make a partial entry update.DELETEto 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.

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

URL:

/v1/documents/1ujkf-GDgB0TQSYPrxbCSK4Uso54tHVMqHZEVZZxB6aY

Method:

GET

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