Skip to main content

Notifications

Community site session details

Community site session details

Session Id : c1okeIySEVtZtVjQJ/GDmW
Power Automate - Building Flows
Answered

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

Like (0) ShareShare
ReportReport
Posted on 24 Oct 2023 20:47:15 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

 

 

 

 

 

 

  • kamoo Profile Picture
    34 on 31 May 2024 at 15:40:00
    Re: Populate a Word document with Excel table data (multiple rows to one output docx file)

    Hello,

     

    Form controls were used for in the actual document.

     

    Every control was labeled for mapping purposes.

     

    You can only use Repeating Sections, Plain text and Picture controls at the moment.


    Make sure to name and tag each control. 

     

     

  • Halgurus Profile Picture
    2 on 31 May 2024 at 14:52:49
    Re: Populate a Word document with Excel table data (multiple rows to one output docx file)

    How did you label your word doc to achieve this result? Did you have to label every attribute in your table?

  • kamoo Profile Picture
    34 on 16 May 2024 at 17:33:08
    Re: Populate a Word document with Excel table data (multiple rows to one output docx file)

    Hi @Just2431,

     

    The value is pulled from the "List rows present in a table" action.

  • Just2431 Profile Picture
    8 on 16 May 2024 at 16:55:12
    Re: Populate a Word document with Excel table data (multiple rows to one output docx file)

    Hello, where does the "value" excel file come from in the select action? and how do I map?

    Just2431_1-1715878496897.png

     

  • Just2431 Profile Picture
    8 on 16 May 2024 at 16:35:54
    Re: Populate a Word document with Excel table data (multiple rows to one output docx file)

    Hi! trying to recreate this. New to power automate and I don't understand where does the "value" excel file comes from in the compose action? I can not atatch a file here so not sure what you did. Please help. Thank you

    Just2431_0-1715877322034.png

     

  • grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on 25 Nov 2023 at 12:52:32
    Re: Populate a Word document with Excel table data (multiple rows to one output docx file)

    You shouldn't be using an Apply to each after your Filter array. You can have a Select after the Filter array that uses the output from the Filter array and remaps the fields/values including formatting the dates/times. Note that you will need to add the expressions as an expression - not just pasting the expression directly into the text area.

  • kamoo Profile Picture
    34 on 21 Nov 2023 at 20:44:04
    Re: Populate a Word document with Excel table data (multiple rows to one output docx file)

    Hello,

     

    Back again with another question.

     

    I'm attempting to format the dates from the output of my Array Filter for a few columns ("Date", "Start Time", "End Time"). My goal is to have the "Date" only display dates and the "Start Time", "End Time" only display time.

     

    Currently they are displayed in the following format: 11/16/2023 12:00:00 AM. 

    kamoo_0-1700598868365.png

     

    For starters I've created a compose action that would modify the "Date" to include only the date, but the output is a mirror of the input (meaning I only see formulas but no data.). Please see the below picture and formula for reference. 

     

    formatDateTime(items(body('Filter_array_condensed'))?['0'], 'yyyy-MM-dd')

     

    kamoo_1-1700599364461.png

    Thank you.

  • kamoo Profile Picture
    34 on 09 Nov 2023 at 22:17:15
    Re: Populate a Word document with Excel table data (multiple rows to one output docx file)

    Please disregard my earlier question, I modified the addDay function and set it to 1. 

  • kamoo Profile Picture
    34 on 09 Nov 2023 at 21:59:42
    Re: Populate a Word document with Excel table data (multiple rows to one output docx file)

    @grantjenkins 


    Again, thank you for your assistance, Grant. I was able to get it work, but your condensed formula is far better. 

     

    This new issue I'm coming across is if I run the flow now, the filter grabs tomorrow and the day after tomorrow.

    It should be filter for today and tomorrow.

     

    Would this be due to how my organization has set the time zone? Or is this something I can alter in the flow?

     

  • Verified answer
    grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on 04 Nov 2023 at 01:55:42
    Re: Populate a Word document with Excel table data (multiple rows to one output docx file)

    In the initial Filter array (you will only need a single Filter array) you would click on Edit in advanced mode for the condition, then paste in the following conditions (which incudes removing items with a blank date).

     

    (
     not(equals(item()?['Date'], '')),
     greaterOrEquals(formatDateTime(item()?['Date'], 'yyyy-MM-dd'), formatDateTime(utcNow(), 'yyyy-MM-dd')),
     less(formatDateTime(item()?['Date'], 'yyyy-MM-dd'), addDays(formatDateTime(utcNow(), 'yyyy-MM-dd'), 1))
    )

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,786 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard