Showing results for 
Search instead for 
Did you mean: 
Resolver I
Resolver I

Nested Apply to Each Loop

Hi. I am testing with a basic table called Learning Sessions:




Thanks to this article (  I am able to get a list of distinct Title values into an Array called DistinctTitle.




My challenge now is to iterate through the DistinctTitle array and find all matching records in the Title column and create a copy of the records in a new worksheet with the distinct Title name. I know that I need to do For Each on the Outputs of the Compose, which is the array and then do a nested For Each on the full worksheet wherever the DistinctTitle value is equal to the Title value and if true, copy to the new sheet. I will appreciate some guidance here.




Solution Supplier
Solution Supplier



I hope I understood your Question correctly...

I made 3 Excel Files. I think you have more but I just made one for all data (Learning Sessions.xlsx) and then just two separate files named "Learning Session 1.xlsx" and "Learning Session 2.xlsx" for those Learning Sessions.

In your case, you would just have more of those files, right? 

The tables inside those three files are all the same layout and all are named the same: "LearningSessions".




Now, for the flow. This is the whole flow:



The nested Apply to each looks like this:



If I run the flow, the results in the Excel files looks like this:




is this what you wanted? Let me know if you need a better explanation on any of the steps in the flow...







Thanks for the response. Your answer does not help with creating new sheets in the same file but I will look at your suggestions and see if I can adapt them to my need.

Resolver I
Resolver I

Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,846)