Microsoft Word Templates

Getting started with Microsoft Word Templates

Microsoft Word Templates enables you to merge data provided by various services with templates and produce Microsoft Word documents as a result.

Template:

Created document:

Template creation

A Template is a regular Microsoft Word document (.docx file) with special tags in its text that determine where and how to merge/fill in data. There are three types of tags: Simple value, Condition and Loop or section.

Simple value

A Simple value tag is simply replaced with a corresponding value. The tag's name corresponds to the Key field's value, which is placed inside double curly braces: e.g. {{name}}.

Template:

> Hi {{name}}!

Module's setup:

Created document:

> Hi Petr!

Condition

A Condition tag enables you to wrap certain parts of a text that should be rendered conditionally. To wrap the conditional text, place it between the opening and closing tags. The name of the opening tag is prepended with a hash sign #, the name of the closing tag is prepended with a slash /.

Template:

> {{#hasPhone}}Phone: {{phone}} {{/hasPhone}}
> {{#hasEmail}}Email: {{email}} {{/hasEmail}}

Module's setup:

Created document:

> Phone: 123456

Loop or section

A Loop or section tag enables you to repeat parts of a text. Similarly to the Condition tag, to wrap the repeated text, place it between the opening and closing tags. The name of the opening tag is prepended with a hash sign #, the name of the closing tag is prepended with a slash /.

When using loops, you can choose to employ either the Fill out a document module or the Fill a document with a batch of data aggregator module.

Fill out a document

If you employ Fill out a document module, the content of the field Value has to be an array of collections, where:

  • Each collection corresponds to one data entry and contains one item entry
  • Item entry contains a collection with two items key and value
  • Item key contains the tag's name
  • item value contains the tag's value

Template:

> {{#contact}}
>     {{name}}, {{phone}}
> {{/contact}}

Module's setup:

Created document:

> Jan Toman, 1234
> Eduard Salo, 7899999

You can also execute a loop to populate a table. The example below shows how to create such table in a template:

Fill a document with a batch of data

If your data entries come as separate bundles, you may prefer to employ the Fill a document with a batch of data aggregator module. You can employ this module also if your data entries come as an array - just employ the Iterator module to transform the content of the array to a series of bundles.

The main advantage of the Fill a document with a batch of data module is that it enables you to easily setup the structure required for the Value field and map items to each value item. In contrast to the Fill out a document module, the field Values contains only a single entry, the actual entries will be created and populated for each incoming bundle. The template will be produced after all input bundles have been processed. The aggregator module is useful especially when creating lists or reports.

Example: Export Google Contacts into a table

The first module loads the template. The next module retrieves all contacts from the specified group in Google Contacts. The aggregator module then aggregates all values retrieved from Google Contacts and merges them into the template. Finally, the last module will save the filled template to a desired location.

Template:

Module's setup:

Created document:

Popular use cases from our blog

automated-data-collection-crm-illustration

How to Automate Data Collection - Part 5: CRM Systems

automated-data-collection-chatbot-marketing-illustration

How to Automate Data Collection - Part 4: Chatbot Marketing

automated-data-collection-paid-ads-illustration

How to Automate Data Collection - Part 3: Paid Ads

automated-data-collection-email-illustration

How to Automate Data Collection - Part 2: Email Marketing Segmentation

personalized-customer-experience-illustration-integromat

5 Automated Solutions to Personalize Customer Experience

data-collection-automation-forms-pt-1

How to Automate Data Collection - Part 1: Online Forms

Didn’t find what you were looking for?

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.