Power Automate: Create Word Document with Repeating Section

Power Automate: Create Word Document with Repeating Section

Create a SharePoint list give it a name of your choice.  E.g. 

  • Name (single-line text)
  • Gender (Choice)
  • Phone Number (number)
  • Email Address (single-line text) 

Enable The Developer Tab in Microsoft Word

This is the word document template that gets populated by Power Automate. Then it gets converted into a PDF and is sent via email.

general

Check the developer tab and then press OK. The developer tab will now appear in the ribbon, and we can use it to create fillable fields in the Word document.

Insert A Table into the Word Document Templatecontact

Add the column headings to the first row of the table and leave the second row of the table blank.

Add Plain Text Fields to The Word Document Repeating Section

Each empty field in the second row will be populated with a text field and then we will use a repeating section to create a new row for each SharePoint list item. contact

 

Enable Design mode to see it. Then highlight the plain text field and select Properties.contact

 

Input the title and tag for the plain text field. Then press OK.gender

Repeat this step for each cell in the second row of the table.

contact

Insert A Repeating Section to the Word Document Template

Highlight the entire row and select the repeating content button from the menu. We have now finished setting up the template. Save the word document template to one drive. 

Open Power Automate and build a new instant cloud flow. Name the flow Contact list flow or any name of your choice. Choose the trigger called Manually trigger a flow and click Create.

flowInsert a Get Items action to obtain all of the contacts information from SharePoint list items.

flow

Add a Select action from the Data Operations actions set to transform the SharePoint list into an array with only the required columns.

flow

Then insert a Populate a Microsoft Word template action and apply it to the Contact List Word document template. Click on the repeating section icon to change the input method.
flow

Then apply the Output of the Select action code to the Table Rows property. This creates a new row in the Word document table for each row in the Contact List SharePoint list.

flow

Create a file using the Microsoft Word document body.
flowConvert the Word Document to PDF.

flow

Then Send an Email (V2) with the Contact List as an attachment. We are now done creating the Power Automate flow.flowRun the flow to generate list of contacts 

flow

Share this Post!