cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Nested Loops (DoUntil...ForEach)

Hi all

I've been trying to nest doUntil & ForEach loops.

I cannot implement a ForEach inside a DoUntil, Flow editor does not offer me such option (see screenshot)

However I can implement a DoUntil inside a ForEach, when saving the Flow no error is shown, and I can execute it successfully.

 

I initially thought nested loops were not supported in flow.

Are these two results design intent? I am specially interested in the successful one

Thank you in advance!

 

nestedLoops.png





If anybody solved your question, remember to mark its post as a solution!

Proud to be a Flownaut!





2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Nested Loops (DoUntil...ForEach)

Taking into account ForEach...DoUntil combination is currently working but is not officially supported, I finally found a workaround that is 100% official and works fine: so I implement the first loop in one flow (the main flow), inside it I invoke a second flow where the second loop is implemented

https://flow.microsoft.com/en-us/blog/build-nested-flows/

 

 

Thank you @v-monli-msft for confirming nested loops are not officially supported!





If anybody solved your question, remember to mark its post as a solution!

Proud to be a Flownaut!





Super User
Super User

Re: Nested Loops (DoUntil...ForEach)

I've just read this post published on the Official Flow Blog two days ago

Work with multi-level arrays with nested Apply to each and other updates

According to the post "...Microsoft Flow can work with scenarios that have nested arrays. You can now put an Apply to each step inside of another Apply to each step..."

I haven't tested it yet, but assuming it works, this is a much better solution than the workaround I found last week.

 

 





If anybody solved your question, remember to mark its post as a solution!

Proud to be a Flownaut!





4 REPLIES 4
Community Support Team
Community Support Team

Re: Nested Loops (DoUntil...ForEach)

Hi @efialttes,

 

May I know why did you need to implement a ForEach inside a DoUntil? This is not avaiable so far in flow.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Nested Loops (DoUntil...ForEach)

Mona

First of all, thank you for your fast response!

I am dealing with an array of arrays, that's why I need nested loops.

 

 

I did some tests and verified:

-one of the DoUntil...ForEach combinations is currently working (the parser accepts it, the execution works fine, the only limitation is when you want to troubleshoot one execution in "Run History", the internal loop ction blocks are not displayed),...

-while the reverse one is not,

so I thought maybe was still not officially supported, that was the reason of my question.

 

Since you've just confirmed it is still not officially supported, I will try to figure out other options. Can you think of any official functionality that can help me to work with an array of arrays?

 

And, if not, an additional question:

Is this feature already planned in Flow Roadmap, or shall I suggest it as a new Idea?

 

Thank you in advance!

 

 

 





If anybody solved your question, remember to mark its post as a solution!

Proud to be a Flownaut!





Super User
Super User

Re: Nested Loops (DoUntil...ForEach)

Taking into account ForEach...DoUntil combination is currently working but is not officially supported, I finally found a workaround that is 100% official and works fine: so I implement the first loop in one flow (the main flow), inside it I invoke a second flow where the second loop is implemented

https://flow.microsoft.com/en-us/blog/build-nested-flows/

 

 

Thank you @v-monli-msft for confirming nested loops are not officially supported!





If anybody solved your question, remember to mark its post as a solution!

Proud to be a Flownaut!





Super User
Super User

Re: Nested Loops (DoUntil...ForEach)

I've just read this post published on the Official Flow Blog two days ago

Work with multi-level arrays with nested Apply to each and other updates

According to the post "...Microsoft Flow can work with scenarios that have nested arrays. You can now put an Apply to each step inside of another Apply to each step..."

I haven't tested it yet, but assuming it works, this is a much better solution than the workaround I found last week.

 

 





If anybody solved your question, remember to mark its post as a solution!

Proud to be a Flownaut!





Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 170 members 3,772 guests
Please welcome our newest community members: