I have to process the name of every folder in a List Files in Folder action. There will only be one result in this activity. Thus, when I get a positive to my condition, I need to terminate the loop. Is there a way to do this? I would love to be able to use Concurrent, then it would be super fast, but concurrent messes with the results of the condition, so thats a no-go. Thoughts?
Please check the below article it uses an approach to break out of an apply to each loop.
Hope this helps!
Well... it fundamentally does work. However, the point of it is to save time. It still takes 32s to run through all 71 items of the loop. It finishes at item 15, but the remainder where the outside loop is 'false' still takes the same amount of time to execute. So, there is not much point in it.
This flow is being initiated from a powerapp. So, I need it to run very fast. I will have to look at a different way to do this.
sorry .. this is currently a limitation and one of the reasons why many people counsel to steer away from For-Each loops if possible.
But without seeing your actual flow I don't see how you couldn't speed this up ... I'm not sure how you are getting filenames but if can pull an array object back Select the Array just to the filename object. then the loop should be really fast.... even with the extra loops.
It's been a UserVoice request for a while now.
Hi @martinav ,
I think you can use do-until by using a similar approach. I am in a similar situation after reading the tread I analysed I can solve my problem using do-until. It will help you also.
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Let me know if I can provide you with more details.
Power Platform & Customer Engagement Developer/Lead/Solution Architecture/Project Manager
Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.