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

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



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

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!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
Dual Super User III
Dual Super User III

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.

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

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 III
Dual Super User III

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!

 

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Dual Super User III
Dual Super User III

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!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
Dual Super User III
Dual Super User III

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.

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,062)