
Announcements
Hi,
I need help in creating a condition based on the previous step run. If the previous steps fails, it needs to execute few set of steps and if no then it needs to execute different steps.
But how can I add the condition based on the previous step and make it happen. Have attached screenshot for reference.
Thanks
Hi @ganeshn07 ,
You can configure the 'run after' to set the actions that will be fired in case of a previous action fails. Here is an example.
I have 2 variables: result (boolean) and number_var (integer). I will try to set a string value to number_var, which will make the action fails. In a future action, the result variable will be set as true if the number_var assignment succeed and as false if it fails:
After that, I will try to assign a string variable to numberic_var, which will result in a failure of the action. And after this assignment, I will create 2 parallel actions, one to set 'result' as true and other to set it as false:
As you may note, the arrow from 'Set variable 3' action is red and dashed. It happens because I reconfigured the run after from the action, making it run only if we have a failure in the previous action (Set variable). To configure it, you click in the 3 dots button, 'configure run after' and select 'has failed':
If you prefer, you can also select other options, like is skipped or has timed out. As for this use case we have different behaviors based on flow success, I unchecked the 'is successful' option.
When I test the flow, it will run the 'Set variable 3' even in the case of failure in 'Set variable' action. Note that 'Set variable 2' action did not run, as the 'run after' is configured to be fired only if the flow succeed. Also, you may notice that even with this "successful" flow run, it will appears as "failed" in your run history.
Let me know if it works for you or if you need any additional help!
-------------------------------------------------------------------------
If this is the answer for your question, please mark the post as Solved.
If this answer helps you in any way, please give it a like.