Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Automate flow to create a file only recreates the same file with same name

(0) ShareShare
ReportReport
Posted on by 32

I've got a automate flow which works 80%.

The flow goes like this;

a file gets uploaded to a sharepoint folder, the flow starts and reads the file name.

The first part of the filename is a number which the flow compares to a table in a spreadsheet and creates copies of the said file with names based on columns from the table.

Not I have multiple rows in the table, so it needs to create the same file with different names, however - it seems to only take the first result from the table and recreate it over again.

 

Here's my flow;

BkkBound_2-1691123434201.png

 

BkkBound_1-1691123414372.png

 

 

Appreciate all help I can get!

 

  • CU26090802-0 Profile Picture
    32 on at
    Re: Automate flow to create a file only recreates the same file with same name

    As you probably notice, i'm new with power automate.

    The reason I'm using a filter array is that I'm always getting a error when trying the output from the listrows.

    "The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each_3')' is of type 'Object'. The result must be a valid array."

    So the only way I can think to fix this is to create a filter array..

     

    Here's a printout of the Table;

    BkkBound_0-1691165449791.png

    And here's the compose function, it comes back with 10 results as the file uploaded started with 13990845, this is double the items in the table

    BkkBound_1-1691165535015.png

     

    However, on the Apply to each function below, its identifying 5 which is correct:

    BkkBound_2-1691166237522.png

    However, it's only creating the file and renaming it 5 times.

     

  • creativeopinion Profile Picture
    10,439 Super User 2025 Season 1 on at
    Re: Automate flow to create a file only recreates the same file with same name

    I'm a bit confused with how your flow is set up. In your List Rows present in a table action, you are already using a Filter Query where the Itemnumber eq Outputs('compose').

     

    Then you have a Filter Query filtering out the List Rows present in a table action values with the same filter. 

    In your Apply to Each action, you are using the value output from the List rows present in a table action. You aren't looping through the filtered items.

     

    Add a Compose action after your List rows present in a table action and add an expression to check the number of items being returned. Use the length() function.

     

    length([value dynamic content from List Rows action])

     

     

    How many items are being returned? Can you also upload a screenshot of the Excel table? It would be helpful.

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 > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492