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;
Appreciate all help I can get!
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;
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
However, on the Apply to each function below, its identifying 5 which is correct:
However, it's only creating the file and renaming it 5 times.
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.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492