cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Dual Super User
Dual 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 anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





2 ACCEPTED SOLUTIONS

Accepted Solutions
Dual Super User
Dual 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 anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





View solution in original post

Dual Super User
Dual 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 anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





View solution in original post

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.
Dual Super User
Dual 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 anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





Dual Super User
Dual 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 anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





View solution in original post

Dual Super User
Dual 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 anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,997)