Generate Word Documents from JSON in Power Automate using Encodian Templater

June 9th 2026

Generating Word documents automatically is a common requirement for many businesses.
Whether you’re generating contracts from structured data, producing automated reports, creating invoices from order data or producing personalised documents at scale, the Encodian Flowr Word – Populate action enables Power Automate to generate Word documents dynamically using structured JSON data.

However, creating the Word templates required for this action can be challenging. The template syntax supports conditional logic, calculations, and repeating collections, but writing those expressions manually inside Word can be error-prone.

Encodian Templater was created to simplify this process.

Templater is a Microsoft Word add-in that generates Word – Populate template syntax visually using representative JSON data.

Instead of writing placeholder expressions manually, you can generate them directly inside Microsoft Word.

How Word Document Generation Works in Power Automate

When generating Word documents from Power Automate, the process typically involves three components:

  1. A Word template containing placeholder expressions
  2. Structured JSON data produced by a flow
  3. The Word – Populate action that merges the data into the template

During execution, the action reads the placeholders inside the Word document and replaces them with values from the supplied JSON payload.

More advanced templates can include:

  • Conditional logic
  • Arithmetic calculations
  • Repeating tables from collections

This allows Power Automate to produce fully formatted Word documents dynamically.

The Challenge of Writing Word Template Syntax

Although the Word – Populate action is powerful, writing the required template syntax manually can be difficult.

Templates often include expressions such as:

  • Field placeholders
  • Conditional blocks
  • Loop structures for collections
  • Calculated values

Small syntax mistakes can break document generation or produce incorrect results.

For teams building document automation workflows, maintaining these templates can become time-consuming. Encodian Templater was designed to reduce this complexity.

Introducing Encodian Templater

Encodian Templater is a Microsoft Word add-in designed specifically to simplify building templates used by the Word – Populate action.

It runs directly inside Microsoft Word and allows template expressions to be generated visually rather than written manually.

By uploading representative JSON data, Templater can generate the correct syntax for placeholders, conditional logic, and collection loops. This makes template development significantly faster and reduces the risk of syntax errors.

Encodian Templater Microsoft Word add-in open in Word with Data, Manual, and Advanced tabs visible
Encodian Templater Microsoft Word add-in

Using JSON to Generate Word Template Placeholders

Encodian Templater generates placeholders based on representative JSON data.

This JSON should reflect the structure that will be passed to the Word – Populate action during flow execution.

To generate placeholders:

  1. Open the Templater add-in inside Microsoft Word
  2. Navigate to the Data tab
  3. Upload a JSON file or paste JSON into the editor
  4. Click Generate

Templater analyses the JSON structure and displays available fields in a hierarchical view.

Selecting a field generates the corresponding Word – Populate expression, which can then be inserted into the document. This approach ensures field names match the runtime data structure.

Uploading JSON data into Encodian Templater to generate Word – Populate tags for Power Automate
Upload or copy JSON data to generate tags

Creating Conditional Logic in Word Templates

Document generation workflows often require conditional behaviour.

For example:

  • Showing sections only when certain conditions are met
  • Switching between alternative content blocks
  • Handling optional data values

The Advanced tab in Encodian Templater allows conditional expressions to be generated visually.

Supported constructs include:

  • if statements
  • else if conditions
  • else blocks

Templater generates the appropriate syntax automatically.

Building conditional logic for a Word template using the Encodian Templater Advanced tab
Build conditional logic

Performing Calculations in Word Templates

Templates can also include arithmetic calculations. This is useful for scenarios such as:

  • Calculating totals or taxes
  • Combining numeric fields
  • Producing calculated values in reports

Encodian Templater supports addition, subtraction, multiplication, and division operations. The generated expressions can be inserted directly into the Word document.

Creating arithmetic expressions for Word – Populate templates in Encodian Templater
Create arithmetic expressions

Generating Tables from JSON Collections

Many Power Automate workflows involve generating repeating rows of data. Examples include:

  • Invoice line items
  • Order summaries
  • Address lists
  • Report tables

Templater can generate the required loop syntax automatically.

By selecting a collection in the JSON structure, Templater creates the appropriate loop expressions and inserts them into the Word template.
This reduces the likelihood of malformed loop structures.

Generating table loops from JSON collections in Encodian Templater for Word – Populate
Generate table loops from JSON collections

Using the Template in the Word – Populate Action

Once the Word template is complete:

  1. Save the document
  2. Add the Word – Populate action to your Power Automate flow
  3. Upload the template
  4. Pass JSON data to the action

The action merges the supplied data with the placeholders inside the template to produce the final document.

If field names do not match the JSON structure or unsupported expressions are used, the action will return an error during execution, unless you choose the Allow missing members option in the Word – Populate action configuration.

Known Limitations

Encodian Templater simplifies template creation but some limitations currently apply. These include restrictions around nested collections and certain extension methods.
A full list of current limitations is available in the support documentation.

When to Use Encodian Templater

Encodian Templater is particularly useful when:

  • Building Word templates for Power Automate document generation
  • Creating templates based on structured JSON data
  • Working with conditional document content
  • Reducing syntax errors in Word – Populate templates

For teams building document automation workflows, this can significantly simplify template development.

 

Author
Jay Goodison

CEO

You might also be interested in...