Inserting Dynamic Tables (Repeating Sections) into Word Templates from Power Automate!
In this tutorial, Nate Halliwell from Pragmatic Works dives into how to insert dynamic tables—also known as repeating sections—into Microsoft Word templates using Power Automate. This feature is particularly useful when automating document generation based on lists of data such as assets assigned to employees. Nate walks through a real-world example using an asset tracking scenario.
📄 Scenario Overview
The example focuses on sending out monthly or yearly asset summary reports to employees. Each employee receives a Word document listing the assets in their possession along with due dates for return.
🔧 Setting Up the Word Template
- Begin with a simple Word document that includes a placeholder for the employee name.
- Enable the Developer tab in Word (if hidden, it can be activated through Word settings).
- Convert the "Insert Employee Name" placeholder into a Plain Text Content Control and rename it to
full_name.
📊 Creating the Repeating Section (Table)
- Insert a 3-column table with headers: Asset Type, Manufacturer, and Due Date.
- For each column in the second row, insert a Plain Text Content Control and name them:
asset_typemanufacturerdue_date
- Select the entire second row and wrap it inside a Repeating Section Content Control.
- Name the repeating section
asset_items.
📁 Preparing JSON Arrays
To feed data into this repeating section, you need to pass a JSON array from Power Automate. Nate suggests using Notepad to draft the JSON structure matching the Word field names. An example array item would look like:
{
"asset_type": "Tablet",
"manufacturer": "Trey Research",
"due_date": "2024-12-31"
}
⚙️ Configuring Power Automate Flow
The Power Automate flow works with two SharePoint lists:
- Asset Holders: List of employees
- Asset Manager: List of assets and assigned users
Steps in the flow:
- Get all asset holders.
- For each asset holder, filter the Asset Manager list using OData query to retrieve only their items.
- Initialize an array variable before looping through their assets.
- Append each asset as a JSON object to the array.
- Reset the array before each loop to avoid carrying over previous data.
📝 Populating and Sending the Word Template
- Use the “Populate a Microsoft Word template” action in Power Automate.
- Map dynamic fields like full name and asset items.
- Switch to Array view for the repeating section and insert the array variable (
var_items). - Send an email with the populated Word document as an attachment, personalized for each employee.
💡 Best Practices from Nate
- Keep field names consistent between the Word template and the array keys.
- Use Notepad or another simple editor to build out JSON arrays before inserting them into Power Automate.
- Reset your array variable inside the outer loop to ensure correct data assignment per employee.
This walkthrough helps automate document generation at scale using Word templates and Power Automate. By leveraging repeating sections and dynamic arrays, businesses can save time and reduce manual errors in recurring reports or correspondence.
Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Power Automate and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.
Sign-up now and get instant access
ABOUT THE AUTHOR
Nate Halliwell is a Power Platform enthusiast, specializing in Power Apps and Power Automate. He began his journey into the Power Platform as a “Citizen Developer” while working as a recruiter in talent acquisition. He used Pragmatic Works to train himself on the technology and hopes to use this new role as a trainer to help others achieve similar career transitions! Nate is PL-900 and PL-100 Certified, and ready to help you take on any Power Apps or Power Automate challenges you or your organization are currently facing! Outside of work, Nate is a husband, a father to 2 boys, and a beer league hockey player.
Free Community Plan
On-demand learning
Most Recent
private training

Leave a comment