web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How do I break a for-e...
Power Automate
Unanswered

How do I break a for-each loop?

(1) ShareShare
ReportReport
Posted on by 94

Hello everybody,

 

I've run into a situation where I need to parse some arrays and break when it finds what I am looking for. I tried using the 'Terminate' function in my loop where it finds a correct datum but I receive an error saying 'Terminate' cannot be used within a for each loop. 

 

Is there any way to perform this logic?

 

Here is a picture of the flow:

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @ChrisC,

     

    Add a do until loop.

     

    u1.png

     

    Thanks

  • v-yamao-msft Profile Picture
    on at

    Hi ChrisC,

     

    For better understanding, could you show me a full screenshot of your flow configuration?

     

    Here is an article about “build more advanced flows than ever”, hope it can be a reference for you:
    https://flow.microsoft.com/en-us/blog/build-advanced-flows/

     

    Best regards,
    Mabel Mao

  • Community Power Platform Member Profile Picture
    on at

    Does it really work?

    Could you provide an example?

    I tried and it throws an error when updating a flow:

    The workflow run action 'Terminate' has type 'Terminate' that is not allowed to be nested under an action of type 'until'.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard