My flow runs well, no problem. However, it bothers me that I get emails telling me that my flow failed which actually means that the condition wasn't met, thus it didn't proceed to the "If yes" branch. I want to be able to add a terminate control with "successfully" terminated so I know that the flow worked as it should have rather than it telling me that it failed.
The reason why I can't add the "terminate" control is because of "Apply to each". Is there a workaround? Here is a screenshot of my flow:
Solved! Go to Solution.
Hi @oaghaei
You can't add terminate inside the apply to each loop.
Follow the below steps.
Add a variable outside your apply to each loop. Try the below
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogPower Automate Video TutorialsHi @oaghaei
Is that the notification email you getting? Generally you only get when flow fails? I did tested a similar IF condition and flow ran successfully. You could try declare a variable outside the loop and set some value inside the no condition. Lets see whether that helps or not.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogPower Automate Video Tutorials@abm , thank you for your reply. What I get is a summary of all flows that "failed". Technically they didn't, but the flow counts them as such because I can't add the "terminate- cancelled" option.
To clarify, the flow does run successfully. That's not the issue.
The issue is that I only want the flow history to say that a flow failed when it truly fails.
Also, can you give me an example of what you mean by "declaring a variable outside the loop and setting some value inside the no condition"?
Hi @oaghaei
Thanks for your reply. What I was thinking is currently you don't have any actions under the No branch. So is that means when flow gets executed and IF condition doesn't satisfy the Yes condition there is No action steps to execute. Not sure that is triggering as a failure or not. Under the No condition you could set a dummy value, yes that is not going to do any other business logic but at least flow will execute always an action for the NO conditions hence I suggested the variable technique.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogPower Automate Video Tutorials@abm , I think I understand where you are going with it, but I don't know what a dummy variable would look like. Would you be able to provide a screenshot of what that would look like?
Yes, I don't have anything in the NO branch because it wasn't allowing me to add the terminate function. This is what it tells me when I attempt to add the terminate function.
Hi @oaghaei
You can't add terminate inside the apply to each loop.
Follow the below steps.
Add a variable outside your apply to each loop. Try the below
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogPower Automate Video TutorialsHi @oaghaei
Look carefully what I suggested under the No. It's called Set Variable. Not initialise again. You already initialised the variable. Search for Set Variable.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogPower Automate Video Tutorials@abm oh!! Thanks for your patience! I'll update my flow and will do some testing and will let you know how it goes.
@abm Looks like maybe something else is missing?
Here is one flow in which I initialized a dummy variable:
and another one:
I think you are looking at this the wrong way. There is nothing wrong with having nothing in the "No" branch and that will not trigger a failure.
I think you are actually experiencing a failure. Most probably in your condition, more than likely in the date comparison. If not it will be in the subsequent apply to each.
You believe it is working because the initial iterations of the loop ARE working, but I suspect some are not. I would add a compose step right before your condition which contains the value on the left side of your condition, then when you get a failure it will be obvious why it occurred (most likely an invalid comparison).
If you do want to put something in the no branch, you can simply put a compose in there with a random string like "no branch was selected". It won't actually do anything, but it might help your troubleshooting
Hi @oaghaei
Where is your set variable? I can't see from the screenshot.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogPower Automate Video Tutorials@abm Nevermind, I think that fixed it! I just need to wait to see if I would get those summary emails with failed flows ๐
Thank you for your time!
Indeed, there were two issues with the flow. Thank you for helping me think through them!
User | Count |
---|---|
78 | |
55 | |
52 | |
42 | |
42 |
User | Count |
---|---|
81 | |
79 | |
75 | |
67 | |
43 |