Template Syntax Overview

The 'Populate Word Document' Power Automate action enables you to populate a word document (DOCX) with data derived from a JSON document.

Basic 'Populate Word Document' Example

To use the 'Populate Word Document' Power Automate action, you'll need to pass the following information:

  1. File Content: The Microsoft Word Document (DOCX) to populate.
  2. Document Data: The JSON data to populate the document with.

If you are not familiar with JSON we recommend the following resource: JSON Introduction

Consider the following simple JSON object:

{
"companyName":"Encodian"    
}

Configuring a word document to receive this data is very simple, just simply use this syntax to add a 'token':

<<[propertyName]>> 

Example Document: Encodian - Template Syntax.docx

You do not need to add content controls or similar, you simply need to add some placeholder text to the document wrapped in the template syntax as a 'token', for example:

mceclip0.png

Configuring Power Automate is also very simple, consider the following flow:

mceclip1.png

Upon executing the flow, the Encodian population engine will automatically detect all tokens which should be replaced with the data contained within the JSON data provided, see below:

mceclip2.png

Document Content Formatting

Example Document: Encodian - Template Syntax - Formatting.docx

The data added to the document will automatically assume the formatting which has been applied to the token, for example:

mceclip5.png

Generate the following output:

mceclip4.png

You must ensure the formatting is applied to the token and not the property inside the token, for example, the following will not work:

mceclip6.png

Have more questions? Submit a request

1 Comments

Please sign in to leave a comment.
Powered by Zendesk