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 / Is there a way to exit...
Power Automate
Unanswered

Is there a way to exit/skip the current iteration of an ApplyToEach loop?

(1) ShareShare
ReportReport
Posted on by 1,811 Super User 2024 Season 1
I have a scheduled flow and inside this flow i have an ApplytoEach and inside the ApplyToEach i have a condition (Condition 12). Now I want to skip the current iteration of the Apply To Each (not to skip the whole flow) in-case the condition (Condition 12) evaluate to true:-
 
 
 
now if i move all the actions inside the current ApplyToEach to be inside the No section of the condition, as follow:-
 
 
 
I will get an error that i can not have more than 8 nested levels, as my flow has a lot of nested actions.. so that why i want to keep all the actions after Conidtion-12 as-is and just skip the current ApplyToEach iteration, incase the Condition-12 evaluate to Yes.. is there a way to do so?
 
Thanks
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    You can introduce a BreakLoop variable as a flag to exit the loop when a specific condition is met. Although Power Automate does not natively support breaking loops (like Apply to each) prematurely, this can be achieved by adding a condition check.
     
    Set the variable BreakLoop to "false" before starting the loop. This flag will be checked during each iteration of the loop.
     
    Inside the loop, check the condition. If it is met, set BreakLoop to true
     
  • johnjohnPter Profile Picture
    1,811 Super User 2024 Season 1 on at
     
    Thanks for the reply.. what is the actual condition which do the exit? i did not get how this flow should be exactly ? can you advice more please?
     
    also will introducing this new condition, raise the max of 8 nested levels?
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    How many nested conditions do you currently have? Adding this condition will further increase the nesting level.
     
  • johnjohnPter Profile Picture
    1,811 Super User 2024 Season 1 on at
     
    As i mentioned in my original question, if i try to move the actions inside the Condition No branch i will get an error that i can not have more than 8 nested levels.. so seems i currently have 8 ...
     
  • Suggested answer
    SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    @johnjohnpeter
     
    Instead of deeply nesting multiple conditions, use parallel branches to handle independent logic paths. This can distribute the logic across branches, reducing the depth of any single branch.
    If you're checking multiple possible values of a single variable, the Switch Case action is a better option than multiple nested conditions. Switch Case allows you to define different actions for different possible values without needing multiple nested conditions.
     
    Would you consider one of those options?
  • johnjohnPter Profile Picture
    1,811 Super User 2024 Season 1 on at
     
    using branches of Switches will not work in my case.. so let concentrate on my original question, about skipping the ucrrent ApplytoEach iteration?
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi
     
    I do want to say, that we don['t work for you, so you should be careful how you talk to the people trying to help you as we do not owe you in any way, you came to us. So let's focus on not being rude and you are lucky Im still answering you.

    The answer is NO you cannot skip. So I should just leave it there, since you have no manners and just expect us to do your work for you.

    You know what.. I changed my mind, I won't show you the answer. I'm sure if you apologize to the others they might. And yes i have a solution for you, based on the tiny bit of details you gave in your flow.
  • johnjohnPter Profile Picture
    1,811 Super User 2024 Season 1 on at
     
    Ok thanks. But I am not sure where i miss-talk with other ? I always thanks people for answering and i am using the world "please".. which shows respect to others.. I have a feeling that you have been posting this to the wrong question? if not , then can you message me on where things get wrong exactly ? and of course i can apologize ,, but i need to know what i need to apologize for exactly ?
  • Suggested answer
    David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at
    If your workflow is in a solution, create a child workflow that does the steps you want to move into the no side of your condition. Then call the child workflow inside the no condition. Here is some information on child flows: Create child Flows - Power Automate | Microsoft Learn
  • johnjohnPter Profile Picture
    1,811 Super User 2024 Season 1 on at

    Thanks for the reply. yes it is inside a solution, and i created child flow before, actually the flow i am showing is a child flow been called from a scheduled flow. So you mean there is not a way to keep my change simple, by just skipping the ApplyToEach iteration in case the condition-12 succeed?

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