How to create Word DOCX document from a template in Zapier, Power Automate (Microsoft Flow), Azure Logic Apps, and PowerApps

Let’s suppose you want to automate the process of generating invoices in your company. This article will describe how to create a DOCX document from a template with the help of Processes, a Plumsail Documents feature.

The Processes are a user-friendly intuitive interface for creating documents from templates, converting them, and delivering to different systems for further management.

With its help, we’ll create an invoice from a template, and this is how the result document will look:

create docx from template

Let’s go through each step from the very beginning:

Configure Process

First, register or login to your Plumsail account.

Create new process

Click on the Add Process button.

add process button

Give a name to the Process to recognize it later. Select DOCX for a template type.

create docx from template

Configure template

Once you’ve created the Process, you’ll proceed to its first step - Configure template.

It includes two substeps:

  • Editor;

  • Settings.

In Editor, you can compose the template from scratch or upload a pre-made one. It’s also possible to modify the uploaded template online.

Feel free to download an invoice DOCX template we have already prepared. Then upload it to the process.

upload template file

Templating syntax

When creating your own templates, mind the templating language. Plumsail Word DOCX templates use a different approach than most other templating solutions. It uses a minimum of syntax to make your work done.

To learn more about the templating engine, check out the documentation article.

In short, the templating engine thinks that everything between such curly {{ }} brackets is variables where it will apply your specified data. In our case the most basic example would be {{invoiceNumber}} and {{date}} tags. They let the engine know that we want to render the invoice number and its date.

But, of course, we can implement a more complex scenario. In our template, we refer to properties inside a collection of products. For that, we use nested tags with a dot operator:

  • The {{product.name}}, {{product.price}} tags get the name, description, and price properties in the product’s object.

The templating engine is smart enough to identify what content to duplicate. It will iterate through all objects in the array to render them and add rows automatically.

tables in DOCX templates

You can learn more about table rendering in the tables section of the documentation.

Test template

To check how the document will look at the end, click on the Test template button. You will see the dialog where you can fill in the auto-generated testing form. Form fields are created from tokens of your document template. You can adjust the look of the testing form by changing token types.

create docx from template

Click on the ‘Create document’, and the resulting invoice will appeat in a new tab. Once you’re satisfied with it, press Save&Next to proceed further - to the Settings substep.

Here you set the following parameters. Descriptions are under the picture.

configure DOCX template

Template mode

It is Testing by default. It means you won’t be charged for this process runs, but result documents will have a Plumsail watermark. Change it to Active to remove the watermark.

Output filename

Use tokens to make it personalized. They work the same way as in the template. For instance, we use the following tokens to define the output file name - {{invoiceNumber}}. As a result, we’ll receive an invoice marked with its number - Invoice 432.

Output type

By default, it is the same as your template’s format. In this particular case, it’s DOCX. And we kept it to create the DOCX Word document from a template.

Test template

Once you’ve customized all the settings, you can test the template to see the result as we did it before.

When everything is done here, click on Save & Next to set up deliveries.

Delivery

The next step is delivery. For demonstrating purpose, we’ll store the result file in OneDrive. But there are other options.

You need to connect to your OneDrive from the Plumsail account. After that, set the folder’s name where to save the ready document. Here you can use tokens as well.

create docx from template

You can configure as many deliveries as you need.

Start Process

Now everything is ready, and you can start generating Word DOCX documents. The step Start process will show available options with a description for each.

start process to create Word from template

You can start the process :

Hint

Use Power Automate Flow and Zapier to connect the process with other apps. It enables you to gather data from one app and pass on to the process to populate a DOCX template. Thus, you can populate the DOCX template from various web forms, CRM systems, SharePoint lists, and thousands of other web applications.

Note

There is another - a little bit more complicated - way to create DOCX documents from a template. Check the article.