web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Populate a Word docume...
Power Automate
Unanswered

Populate a Word document with Excel table data (multiple rows to one output docx file)

(0) ShareShare
ReportReport
Posted on by 34

Hello,

 

Hope you are all well.

 

I'm attempting to create a flow that takes rows from an excel sheet and populates it into a word document. This is to generate a daily construction activity memo.

 

The trigger is manual.

 

The data in the Excel is structured (see image below) in a way that I need to return multiple rows from excel to populate a single table/generate a single document in word.

kamoo_0-1698177486795.png

 

I have created a word template with the below fields (see below) and have nested Plain Text Content Controls within a Repeating Section Content Control.

kamoo_1-1698179142786.png

The below images are from the flow that I created.

 

I understand that the "apply to each" is a loop, and I know I'd have to append but I'm not entirely sure how to as I'm new to this.

 

Any help would be greatly appreciated. Thank you.

 

kamoo_2-1698179822146.png

kamoo_3-1698179935408.png

 

 

 

 

 

 

Categories:
I have the same question (0)
  • Alex_Rackwitz Profile Picture
    9 on at

    @kamoo 

    Just to clarify, you have transposed the data. Each row in Excel will become a column in Word? 

    Or do you want multiple tables with 2 columns, each table representing a row in Excel, in a single Word file?

  • kamoo Profile Picture
    34 on at

    Hello Alex, @Alex_Rackwitz 

     

    Yes, the latter as you described it.

     

     

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    You don't want to use an Apply to each loop for this as that would end up creating multiple documents.

     

    I'm using the sample Excel Table below.

    grantjenkins_1-1698206421571.png

     

    See full flow below. I'll go into each of the actions.

    grantjenkins_0-1698206394086.png

     

    List rows present in a table retrieves the data from my table.

    grantjenkins_2-1698206465144.png

     

    Select maps the fields we want to use in our Word Template. Note that the Headers you specify here need to match the names of the Controls you added in your Word Template. In my case, the Excel Table has a header called Job Title, but my control is named JobTitle (no spaces).

    grantjenkins_3-1698206560874.png

     

    Populate a Microsoft Word template uses the output from the Select to build the repeating table. You'll see that my repeating table is called DetailsTable and I've changed it to array mode to add the Select output.

    grantjenkins_4-1698206657829.png

     

    Create file uses the content from Populate a Microsoft Word template.

    grantjenkins_5-1698206720991.png

  • kamoo Profile Picture
    34 on at

    @grantjenkins 

     

    Thank you for your help. I was able to populate a sheet with multiple rows. (I noticed that there were additional attempts made on the sheet blank fields).

     

    The issue I'm running now is that two (2) of the fields are not populating, mainly for "Location" and "Building Services". (See Below).

    kamoo_0-1698261214912.png

     

    I've rechecked "Select" step and can confirm that all fields are labeled and mapped correctly. These fields appeared in my initial flow creation.

     

     

     

     

     

  • kamoo Profile Picture
    34 on at

    @grantjenkins 

     

    I was able to correct this issue. It was due to the extra rows in the table, and I failed to add the proper tag to the controls in question.

  • kamoo Profile Picture
    34 on at

    @grantjenkins 

     

    Okay. I'm now attempting to filter my results before populating the word document. I would like the filter to include only the current day and the day after. I've added a "Filter Array" after the "List rows in table", but it has not filtered out the additional days. (See below). Would it be possible for me to filter and sort with ODATA only? I've attempted to do so but, my syntax is wrong. 

    The Flow

    kamoo_1-1698273638172.png

    Screenshot 1

    kamoo_2-1698273701169.png

    Screenshot 2

    kamoo_3-1698273808448.png

     

    Should I be adding the "Filter Array" before populating the word document?  

    In addition, I'd like to format the "Date" to remove the time and as well as format the "Start Time" & End Time" to remove the date. Can I add this function into the "Select" operation? (See below for reference).

    kamoo_0-1698273583786.png

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Are you sure the Filter array isn't working correctly? I think the issue might be because you are still using the output for your Select from List rows present in a table and not the output from the Filter array.

  • kamoo Profile Picture
    34 on at

    @grantjenkins 

     

    Yes, I can confirm that I've chosen the correct output. But I'm having trouble figuring out the correct sintax.
    Please see the below image for reference. My goal is to filter for only the current day and the day after based on the "Date" column. I understand that the greaterorequal function requires that both items be of the same type. 

     

    kamoo_0-1698698927401.png

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    I mean in your Screenshot 1 it looks like your Select is getting the output from List rows present in a table, but it should be using the filtered output from the Filter array instead.

     

    grantjenkins_0-1698812714592.png

  • kamoo Profile Picture
    34 on at

    @grantjenkins 

    Please refer to the below image, I've made a change to the flow since posting that (Not sure if it is for the better). I have now placed the Filter Array after the Select. 

     

    (Select output highlighted in Yellow, Filter Array output highlighted in Blue)

     

    In the Filter Array I've selected the option for greater than or equal as that would fit into my filter criteria. Not sure of the sintax.

    Should I have just left the flow in the original format? 

     

    Thank you.

     

    kamoo_0-1698849034972.png

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard