Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Automate Excel to Word creating new file when field value changes

(0) ShareShare
ReportReport
Posted on by 37

I have an Excel document with a list of different columns (client, value, policy no) in a format like;

 

ClientValuePolicy No
Client A£50A1
Client A£80A2
Client B£60B1
Client B£25B2
Client B£90B3
Client C£500C1

 

I would like to automate the process of having a word document for each client containing just the data related to them.

 

I have found a few different community forums about this topic but I cannot get any of them to work.

 

I have tried to follow this guide: https://www.bythedevs.com/post/how-to-populate-a-word-template-with-repeating-control

 

Which gets me most of the way, I can get separate documents but they all contain the full contents of the Excel spreadsheet, not just the rows related to 1 client.

 

Any help would be appreciated!

  • trice602 Profile Picture
    13,768 Super User 2025 Season 1 on at
    Re: Automate Excel to Word creating new file when field value changes

    Nice!  Have a great day over there and feel free to tag me in future posts; I enjoy solving puzzles!  Always glad to help! Tom

  • FDUN89 Profile Picture
    37 on at
    Re: Automate Excel to Word creating new file when field value changes

    Got it working! Thank you

  • Verified answer
    trice602 Profile Picture
    13,768 Super User 2025 Season 1 on at
    Re: Automate Excel to Word creating new file when field value changes

    Hi @FDUN89 ,

     

    Here's a solution that does this except it doesn't write to a Word document (this one stops at creating a table and can be used to send to Word, send an email, other actions, etc).  Here's the entire flow to the step sending to Word which you said you already have working, just need to rows specific to Indvidual clients. 

     

    trice602_0-1691579756154.png

     

    The first apply to each gets all the emails (or clients in your case meaning this could be an account name) in an array and we are appending this variable with all clients from every row, including duplicate values.

     

    trice602_1-1691579913240.png

     

    Next you compose a union on your EmailList array and this removes duplicate values.  So in your case, you end up with an array variable of client names, emails, account numbers, etc - whatever you want.

     

    trice602_2-1691580054280.png

     

    The last step to get your unique rows for each client is to create a filter.  Here I am using the output of my client list from Compose Union and creating a filter array.  The "from" is the body of the excel step (list rows present in a table) where the current item (from the union) is equal to the email value in the excel worksheet - again could be anything you want, doesn't have to be an email.

     

    This is going to give a table of rows pertaining to an individual client.  In your case immediately below create html table, inside the same apply to each, you will want to plug in your Word actions so for each client you are getting their rows in excel and pasting into word, etc.

     

    Please mark as a solution if this is helpful!  I am using this flow in a handful of variations in production and never disappoints.  Always glad to help! Tom

     

    trice602_3-1691580159277.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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >