How to autofill DOCX from Google Sheets data

Docmosis Cloud is a template-based document generation service that can be used via a REST API.

This article is a step-by-step guide to:

  • create a Google Sheet
  • sending data stored in a Google Sheet to the Docmosis Cloud Service using Zapier
  • generating a DOCX/PDF document with the data

Overview

In this example we make use of Zapier so that each time in the Google Sheet a new row is created or updated, the data is sent to the Docmosis Cloud service. The Cloud service merges the data with a Microsoft Word template to generate a DOCX Document, like this one:

Docx Autofilled from Googlesheet dataDownload the generated document

Configure Docmosis for document generation

Step 1:Login to the Cloud console

If you don't already have a Cloud account, you can sign up for a Docmosis free trial here. Once you have an account, log in to the Cloud console.

Image of a login page to DWS4 Docmosis

Step 2: Download the sample template

Docmosis templates are ordinary Microsoft Word documents, with special placeholders that Docmosis Cloud service replaces with data when it generates the document. Create a new top-level folder, for storing the sample template. 

Click on the image or link below, to download the sample template: EmploymentAgreement.docx.

The EmploymentAgreement.docx template is ready to use, without any further changes. You can see the placeholders in the template, below.

Placeholders in the Docx template

Download the template

Note: The placeholders serve as unique identifiers, helping Docmosis Cloud Service in determining the data's placement.

For example, in the above template if you decide to change "FirstName" to "Your_Name" it would not effect the functionality of template as long as of you replace every instance of "FirstName" with "Your_Name".

Step 3: Upload the Sample template

Create a new top-level folder to help organize your templates. In this case the folder is named Zapier.

Upload the EmploymentAgreement.docx. template to the Google Sheets folder in the Cloud console.

Upload the Docx template to Docmosis

Step 4: Get the Docmosis Cloud Access key and API URL

You will need your access key and URL when setting up the call to Docmosis Cloud in Zapier. Copy these to an editor such as Notepad, to be used later.

Note: In this example, we used the US (Oregon) processing location in the Docmosis Cloud Service, for storing the template and generating the document. You can use your default processing location, when following this example.

Setting up Google Sheets

Step 5: Build a new spreadsheet in Google Sheets.

Sign in to Google Sheets

Create a new spreadsheet

Note: Zapier requires the spreadsheets to have column headers, when using Google Sheets as a trigger. 

Create a Google Sheet

Configure Zapier 

Step 6: Set up a Zap in Zapier with Google Sheets as trigger 

Log in to Zapier. Click on any of the "Create Zap" buttons. Optionally create a folder.

Click on trigger step then search and select Google Sheets as trigger from the "Change trigger" pop-up.

  • In the "App & event" section choose "New or Updated Spreadsheet Row " as Event.
  •  In the "Account" section Authenticate your Google Sheets account
  •  Choose the desired Spreadsheet and Worksheet. Optionally choose a Trigger column.
  • "Test" to see the rows are populated as data 
    Connect Google Sheet to Zapier       Google Sheet trigger in Zapier

Step 7: Configure Docmosis as a Action.

Click on the Action section, then search and select Docmosis in the "Change action" pop-up. In the "App & event" section,  Select "Generate a Document" as Event. then click continue

Connect Docmosis to ZapierStep 8 : Connect your Docmosis Cloud account to Zapier

To connect Docmosis with Zapier, first click on the "Sign in" button located in the "Account" section.

This will open a new authentication window, where you must

Step 9: Fetch template 

 In the "Action" section, fetch the template by providing

  • Processing location
  • Template name

 Docmosis Cloud service requires a Output filename and data for placeholders to generate a document.

Note: Include a extension when specifying Output filename must include an extension i.,e ".pdf" or ".docx", this determines the format of the generated Document.

Docmosis Trigger in Zapier

Step 10: Map the Spreadsheet columns to the Docmosis Placeholders 

To map Columns with Docmosis placeholders, simply select the desired columns from the dropdown list. 

Note: The Docmosis placeholders are automatically populated once template is selected. The Google Sheet column headers are shown as a dropdown list when the "Enter text or insert data" box is clicked. 

map Docx Template fields to Google Sheet Columns

Step 11: Optionally set up a email delivery.

This is the easiest way to confirm that all settings are correct. Later on you can add more steps to your Zap to perform further actions with the document.

To setup email delivery enter the email, subject and body of email in the corresponding fields.

Note: From a Docmosis Cloud Free Trail account emails can only be sent to the Docmosis Account Admin(s).

Step 12: Test the Zap.

Check your email. The generated document will arrive in the email as an attachment.

That's it! Publish the Zap and every time the form is completed you will receive a generated document.

Feedback

Invalid Input

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam. Please also consider contacting support@docmosis.com if you need help with this article.

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Invalid Input

Applies To

Docmosis-Java Tornado Cloud
Version(s) - - DWS4