Google Doc Template Guide

This page explains DocsAutomator's template syntax and how to create the perfect template in Google Docs

We have created a variety of templates for the most common use cases. Please head over to our Template Gallery to have a look.

If you need help creating your perfect template, please consider using our Template Creation Service.

Google Drawings cannot be used in templates and will cause an error. Please add those as images.

DocsAutomator's Template Syntax

Why Google Docs? Learn all the benefits!
  1. Google Docs is one of the most intuitive word processors ever made, making the template creation process as easy as possible

  2. Dynamically generated documents can be edited and changed

  3. DocsAutomator offers all of Google Docs' features out-of-the-box

  4. Access can be given to anyone with a Google Docs account, inside and outside your organisation

In DocsAutomator, you declare variables / placeholders using curly brackets: {{...}} . There are three different types of variables:

  1. Text variables / placeholders

  2. Image variables / placeholders

  3. Line item variables / placeholders

1. Text variables / placeholders

Text variables can be declared anywhere in the document (incl. headers and footers) and are defined like so:


Examples: {{name}}, {{someUniquePlaceholderText}}

The name for the variable has to be unique across the document, but you can use the same placeholder multiple times, yet only have to pass data once. Here you see an example of various text placeholders on an invoice:

2. Image variables / placeholders

If you want to dynamically add images to your documents, you need to use DocsAutomator's special image syntax.


Examples: {{image_headshot}}, {{image_product}}, {{image_someUniqueText}}

When declaring an image placeholder, DocsAutomator expects a single image or multiple images to be passed. For more, see the following detailed guide: Dynamic Images

3. Line item variables / placeholders

Line items allow you to add lists of data, for instance positions on invoices, tracked times on timesheets and many, many more use cases. They are important parts of more complex documents.

In DocsAutomator, you declare line items as a line item row in a table. Here is an example:

Example with printed data:

This example has a header row with static text. The second row shows how to declare a line items row. In this case, it's the first line items row in this document (line_items_1). You can add as many line item rows as you want and you keep incrementing the number (next line item row would be line_items_2).

Declaring line items tells DocsAutomator that you're going to pass a list of things and DocsAutomator will then iterate over that list and create a single row for every item. As you can see, static text can be added here and you can also use multiple variables per cell. Line items allow for flexible customization of your documents, please see the in-depth article here: Line Items

Tips, tricks and important info

Creating a template from scratch can be hard. Here are a few handy tricks to make crafting a great template easier:

Start with a template

Instead of starting from scratch, consider using a template from our Template Gallery.

Tables for positioning

Tables are not only great tools for displaying tabular data, but they can also be used to position elements. The common approach is to hide table borders in this case. The trick is to display borders as long you're working and positioning and hide borders once you're finished.

Fixed positioning for images

Positioning images can be tricky sometimes. An easy hack is to apply a fixed position for an image (in front of or behind text). This only works if text is not going to interfere with the position (so often in headers, footers or on top of pages):

Sharing settings

If you're keeping a generated Google Doc after document generations, sharing settings are inherited from the parent folder of the Google Doc. If you've selected a Google Drive folder in your automation, sharing settings of that folder apply. If you haven't, the template folder applies.

Last updated