Connect a Data Source
Navigation
- Getting Started with Build a Doc
- Purchase a Subscription
- Use the Customer Portal
- Generate an API Key
- → Connect a Data Source (You are here)
- Create a Template
- Build a Power Automate Flow
You’ll achieve: A connection your first data source in Power Automate and a preview in the Word Add-in.
What is a Data Source?
A data source is the information that fills in your template placeholders. When Build a Doc processes your template, it replaces tags like <<[Customer.Name]>> with actual values from your JSON data.
In this quickstart, you’ll learn to connect a simple invoice data source in both Power Automate (for automation) and the Word Add-in (for testing).
Connect a Data Source in Power Automate
You’ll connect data in the Build a Doc action when building your flow.
Step 1: Add the Build a Doc Action
- In your flow, click + New step
- Search for Build a Doc and select Convert Word Document
First time only: Create a connection
Before continuing, set up the Build a Doc connection:
- Build a Doc Subscription: If you don’t have one, purchase a subscription
- API Key: Generate one in the Customer Portal
Then in Power Automate:
- Enter connection name:
Build a Doc Production - Paste (don’t type) your API key
- Click Create
Step 2: Add Your Template
- In the Document field, select your template file (from SharePoint or OneDrive)
Step 3: Connect Your Data Source
In the Data Sources section, you’ll add your JSON data:
- Name: Type
Invoice(this must match your template tags) - Data: Insert your JSON data. An example is below. For more information on creating data, see below, or the JSON Structure and Sample Data section of the Authoring Advanced Word Templates guide.
[ { "Name": "Invoice", "Data": { "InvoiceNumber": "INV-2025-001", "InvoiceDate": "2025-03-15", "Customer": { "Name": "Roger Woodfield", "Email": "roger@example.com" }, "Items": [ { "Description": "Web Development", "Quantity": 1, "Price": 3500 } ], "TotalAmount": 3500 } }]- Format: Select JSON
When your flow runs, this data will populate your template.
Preview with the Word Add-in
Test your data source before using it in production by previewing in Word.
Step 1: Open the Add-in
- Open your Word template
- Go to Insert → My Add-ins → Build a Doc
- If not installed, go to Insert → Get Add-ins, search for “Build a Doc”, and click Add
Step 2: Add Sample Data
- In the Build a Doc panel, click the Build tab
- Paste the same invoice JSON from above into the Data section
- Click Generate Preview
You’ll see your template populated with the invoice data.
Understanding Your JSON Data
The JSON you just used contains three types of data:
Simple fields - Direct values:
[ { "Name": "Invoice", "Data": { "InvoiceNumber": "INV-2025-001" } }]In templates: <<[InvoiceNumber]>>
Nested objects - Grouped data:
[ { "Name": "Invoice", "Data": { "Customer": { "Name": "Roger Woodfield" } } }]In templates: <<[Name]>>
Arrays - Repeating lists:
"Items": [ { "Description": "Web Development" }]In templates: Use foreach loops (covered in the next quickstart)
Key Rules
| Rule | ✅ Correct | ❌ Incorrect |
|---|---|---|
| Array format | [{ "Name": "John" }] | { "Name": "John" } |
| Quotes | "Name": "John" | 'Name': 'John' |
| Case sensitivity | "Customer" | "customer" |
| Trailing commas | "A": 1, "B": 2 | "A": 1, "B": 2, |
Common Issues
| Issue | ✅ Correct | ❌ Incorrect |
|---|---|---|
| Fields appear blank | Data source Name matches template (case-sensitive) | Data source Name doesn’t match or uses wrong case |
| Invalid JSON | "A": 1, "B": 2 with double quotes "Name" | "A": 1, "B": 2, with trailing comma or 'Name' with single quotes |
| Data in Word Add-in | Wrapped in array: [{ ... }] | As object: { ... } |
What You’ve Achieved
- Connected a data source in Power Automate
- Previewed data in the Word Add-in
- Understand basic JSON structure (fields, objects, arrays)