Skip to content
This documentation is currently in preview, therefore subject to change.

Create a Template


You’ll achieve: A working Word template with dynamic placeholders.


Before You Start

You need:

  • Microsoft Word (Desktop or Online)
  • Build a Doc Word Add-in (install from Microsoft Store)
  • JSON data prepared (see Connect a Data Source)

How to Install the Word Add-in

The Build a Doc Word Add-in is a useful tool designed to enable the user to view what their documents will look like. It is recommended to use the Add-in whilst you are creating your template.

Adding the Build a Doc Word Add-in

To use the Build a Doc Word Add-in for template authoring:

  1. Open Microsoft Word (Desktop or Online)
  2. Click the Home tab → Add-ins
  3. Search for Build a Doc
  4. Click Add to install

The Build a Doc pane will appear on the right side of Word, ready for template validation and preview.


Plan Your Template with Data in Mind

Before you start designing, review your JSON data structure from Connect a Data Source. Your template layout should reflect how your data is organised:

  • Root fields (e.g., InvoiceNumber, InvoiceDate) → add as simple text placeholders
  • Nested objects (e.g., Customer.Name, Customer.Email) → add in grouped sections (like “Bill To”)
  • Arrays (e.g., line items) → use table rows with <<foreach>> loops to repeat

This alignment between data structure and document layout ensures your tags match your data perfectly.


How to Design Your Document

Create your document layout first:

  1. Add your company logo
  2. Add static text:
INVOICE
Invoice Number:
Date:
Bill To:
  1. Create a table for line items:
DescriptionQuantityPriceSubtotal

How to Add Simple Field Tags

Replace static placeholders with tags:

Format: <<[Invoice.FieldName]>>

Example:

Invoice Number: <<[Invoice.InvoiceNumber]>>
Date: <<[Invoice.InvoiceDate]>>
Total: $<<[Invoice.TotalAmount]>>

Success: These tags will be replaced with actual data.


How to Add Customer Information

For nested objects, use dot notation:

Bill To:
<<[Invoice.Customer.Name]>>
<<[Invoice.Customer.Email]>>

How to Add Repeating Line Items

For arrays, use <<foreach>> loops:

In your table:

DescriptionQuantityPriceSubtotal
<<foreach [Item in Invoice.Items]>><<[Item.Description]>><<[Item.Quantity]>>$<<[Item.Price]>>$<<[Item.Quantity * Item.Price]>>
<</foreach>>

Success: This repeats one row per item in your data.


Tag Syntax Rules

Element✅ Correct❌ Incorrect
Tag wrapper<<[Field]>><[Field]>
Nested fields<<[Customer.Name]>><<[CustomerName]>>
Case-sensitive<<[Customer.Name]>><<[customer.name]>>
No spaces<<[Field]>><< [Field] >>

How to Preview Your Template

  1. Open your template in Microsoft Word
  2. Open Build a Doc Add-in pane
  3. Click Build tab
  4. Paste your JSON data
  5. Click Generate Preview

Success: You see your data populated in the document.

If tags don’t work:

  • Verify tag names match JSON keys exactly (case-sensitive)
  • Check foreach loops have <</foreach>>
  • Ensure JSON is valid

How to Save Your Template

  1. Click FileSave As
  2. Choose location (OneDrive or SharePoint recommended)
  3. Name it: e.g. Invoice-Template.docx
  4. Save as Word Document (.docx)

Success: Your template is ready for Power Automate.


Complete Template Example

INVOICE
Invoice #: <<[Invoice.InvoiceNumber]>>
Date: <<[Invoice.InvoiceDate]>>
Bill To:
<<[Invoice.Customer.Name]>>
<<[Invoice.Customer.Email]>>
---
| Description | Qty | Price | Subtotal |
|-------------|-----|-------|----------|
| <<foreach [Item in Invoice.Items]>><<[Item.Description]>> | <<[Item.Quantity]>> | $<<[Item.Price]>> | $<<[Item.Quantity * Item.Price]>><</foreach>> |
---
Total: $<<[Invoice.TotalAmount]>>

How to Fix Common Errors

Problem✅ Solution
Tag doesn’t match JSONUse dot notation: <<[Customer.Name]>>
Loop doesn’t closeAlways add <</foreach>>
Wrong caseMatch JSON exactly: Customercustomer
Syntax errorUse format: <<[Field]>>

What You’ve Achieved

You now have:

  • A working Word template
  • Dynamic placeholders for data
  • Repeating sections for arrays
  • Preview capability with the Add-in