Google Doc Template Guide
This page explains DocsAutomator's template syntax and how to create the perfect template in Google Docs
Last updated
This page explains DocsAutomator's template syntax and how to create the perfect template in Google Docs
Last updated
Google Drawings cannot be used in templates and will cause an error. Please add those as images.
In DocsAutomator, you declare variables / placeholders using curly brackets: {{...}}
. There are three different types of variables:
Text variables / placeholders
Image variables / placeholders
Line item 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:
If you want to dynamically add images to your documents, you need to use DocsAutomator's special image syntax.
{{image_...}}
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
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
Creating a template from scratch can be hard. Here are a few handy tricks to make crafting a great template easier:
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.
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):
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.
Instead of starting from scratch, consider using a template from our .