Create a Template
Navigation
- Getting Started with Build a Doc
- Purchase a Subscription
- Use the Customer Portal
- Generate an API Key
- Connect a Data Source
- → Create a Template (You are here)
- Build a Power Automate Flow
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:
- Open Microsoft Word (Desktop or Online)
- Click the Home tab → Add-ins
- Search for Build a Doc
- 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:
- Add your company logo
- Add static text:
INVOICE
Invoice Number:Date:Bill To:- Create a table for line items:
| Description | Quantity | Price | Subtotal |
|---|---|---|---|
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:
| Description | Quantity | Price | Subtotal |
|---|---|---|---|
<<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
- Open your template in Microsoft Word
- Open Build a Doc Add-in pane
- Click Build tab
- Paste your JSON data
- 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
- Click File → Save As
- Choose location (OneDrive or SharePoint recommended)
- Name it: e.g.
Invoice-Template.docx - 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 JSON | Use dot notation: <<[Customer.Name]>> |
| Loop doesn’t close | Always add <</foreach>> |
| Wrong case | Match JSON exactly: Customer ≠ customer |
| Syntax error | Use 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