Create Word document from template by populating it in Power Automate
Note
There is a simpler way to create and populate PDF documents from a template and use the result in Power Automate if needed.
Overview
Suppose you want to automate the generation of invoices in your company. In this article, you will learn how to populate Word templates in Power Automate (formerly Microsoft Flow) and Azure Logic Apps using the Plumsail Documents action Create document from DOCX template.
You can use this approach to populate Word templates and generate documents such as contracts, quotes, and reports.
Typically, invoice data is generated in a third-party system. Then you get this data in Power Automate, populate a Word template with the data, and generate a new document.
This is how the final document will look in our case:

Our template and the resulting document have to be stored somewhere. Power Automate has a lot of connectors for different systems. Here are just a few of them:
SharePoint
Box
OneDrive
Google Drive
Dropbox
SFTP
File System
In this example, we will store our documents in SharePoint. Our flow will use a JSON object as the source data for the template, but you can get data from other sources. For example, query list items from SharePoint.
This is how the flow looks:

Flow structure
Let’s review all the actions in detail and break down the flow step by step.
Trigger
You can pick any trigger. For example, you can start a flow on file creation in a SharePoint document library.
We are using the Manually trigger a flow trigger here to simplify the flow.
Get file content
This action gets the file content of the specified file from a SharePoint document library. You just need to specify the SharePoint site URL and path to your file. We use this action to get the content of the Word template.

You can use any other connector to get files from your system.
Create Word document from template
This is the action from the Plumsail Documents connector. This action is used to create Word documents by populating DOCX templates with data in Power Automate. You can find more information about this action by visiting this page. Find the Plumsail connector in Power Automate.

Then, find a Create document from DOCX template action.

There are four main parameters:
Template file
Document output type
Template data
Template engine
In the first parameter, Template file, you can put template content from another action. In our case, we specified the output of the previous action as the template.
Download the template file that we will use in this article. You can also use your own Word DOCX template to populate the data you need.

Plumsail Word DOCX templates use a different approach than most other templating solutions. It uses a minimal amount of syntax to define dynamic content.
Read this article to get familiar with the templating engine.
In short, the templating engine treats everything inside the {{ }} brackets as variables and replaces them with the data you specify in Template data.
In our case, the most basic examples are the {{INVOICENUMBER}} and {{date}} tags. They let the engine know that we want to render the invoice number and its date.
Of course, we can implement more complex scenarios. In our template we are referring properties inside simple objects and collections, as well as properties in nested structures. To select properties of our objects inside the array (in JSON data), we are using a dot operator:
The
{{company.address}},{{company.email}},{{company.phone}}tags let the engine know that we want to render properties of the company object.The
{{items.product.name}},{{items.product.price}}tags get the name, description and price properties in each item’s product object.
The templating engine is smart enough to understand what content needs to be duplicated. It will iterate through all objects in the array to render them and add the rows automatically.
You can learn more about table rendering in the tables section of the documentation.
In the second parameter, you can select the output type of the resulting document: DOCX or PDF.

In the third parameter, we specified the data that is being applied to the template in JSON format:
{
"invoiceNumber": "432",
"company": {
"email": "sales@sample.com",
"address": "3 Main St.New York NY 97203 USA",
"phone": "202-555-0131"
},
"date": "2026-02-06",
"items": [
{
"product": {
"name": "Monitor",
"price": 99
},
"quantity": 10,
"cost": 990
},
{
"product": {
"name": "Stapler",
"price": 12.44
},
"quantity": 1000,
"cost": 12440
},
{
"product": {
"name": "Fridge",
"price": 4219.99
},
"quantity": 1,
"cost": 4219.99
},
{
"product": {
"name": "Microwave",
"price": 99.99
},
"quantity": 5,
"cost": 499.95
},
{
"product": {
"name": "Pen",
"price": 7.23
},
"quantity": 100,
"cost": 723
}
],
"total": 18872.94
}
In the last parameter, you can select the templating engine: Classic or Modern. Please refer the Modern vs. Classic DOCX engine article to learn more about the differences between template engines.

Create file
Now you need to store the file somewhere. In our example, we use the Create file action from the SharePoint connector to store the Word DOCX document in a SharePoint document library.

You can use any other connector to store documents in your system.
Conclusion
Now you should have an idea of how to use the Create document from DOCX template action from Plumsail Documents connector for Power Automate. If you haven’t used it yet, registering an account would be the first step. It is quite easy to get started.