I have three conditions that I am needing to run and if criteria is met then send email but would like to have the first one run and if it successfully sends an email then I would like the flow to stop and not run the other conditions. Is this possible? Can someone explain how to do this?
If I understood correctly you need to split your IF conditions with each flow actions. If not send an example of your requirement.
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.
This might be too basic a suggestion, but could you add a 'condition' or 'case' action inside your 'Apply to each' operations? You could have one branch that contains no further actions.
You could also use a 'Do Until' loop. For example:
Then, if stopFlow is still false after the first 'Do Until' loop completes, you can run your other operations afterwards.
There is a 'Terminate' action in Flow that might also be useful to you, but you can't use that inside the loop.
Hope this helps!
Yes so I would like Condition "Pending" to run and if the criteria is met and it sends an email then I do not want the other two to run. If the criteria is not met then I want the next condition "Meet or Does Not Meet Criteria" to run. If the criteria is met and sends an email then I do not want the third one to run. If it doesn't send an email then I want the third to run.
I am still learning so examples would be appreciated as I don't understand some of the "terms" of Flow.
Hi @Tbruns, it sounds like you want the conditions to run like this:
My big question to you is, 'Do you want to stop running your loop the first time one item in your list meets any of your three conditions? Or, do you want to run your first condition on all list items, your second condition on all list items (only if the first condition failed), and then your second condition on all list items (only if the other two conditions failed).
If it's the case that you want to stop running your loop the first time one item in your list meets any of your three conditions, here's my understanding of your workflow:
I've attached an example Flow image. It starts off like yours, triggered by when an item is added to the list. Then it uses 'Initialize Variable' to create the stopFlow variable (set to false initially). Then comes the loop. Apply to each list item, first check that the conditions have not yet been satisfied. Then, I get the item.
Below, I've used the 'Switcher' action to process the item. This lets you set multiple alternatives provided they're all on the same field (e.g. if status is 'Pending', carry out the actions in case1; if status is 'In Progress', carry out the actions in case2, and so on). If one of the 'Switch' options satisfies the conditions, then I send an email and update 'stopFlow' to true to show I don't need to run any of the other conditions. If you can't use a Switcher for your circumstances, you can use multiple 'Conditions' instead.
Hope this gives you some ideas.
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!