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

Connect a Data Source


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

  1. In your flow, click + New step
  2. 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:

  1. Build a Doc Subscription: If you don’t have one, purchase a subscription
  2. API Key: Generate one in the Customer Portal

Then in Power Automate:

  1. Enter connection name: Build a Doc Production
  2. Paste (don’t type) your API key
  3. Click Create

Step 2: Add Your Template

  1. 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:

  1. Name: Type Invoice (this must match your template tags)
  2. 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
}
}
]
  1. 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

  1. Open your Word template
  2. Go to InsertMy Add-insBuild a Doc
  3. If not installed, go to InsertGet Add-ins, search for “Build a Doc”, and click Add

Step 2: Add Sample Data

  1. In the Build a Doc panel, click the Build tab
  2. Paste the same invoice JSON from above into the Data section
  3. 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 blankData 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-inWrapped 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)