Which activity should I use to end the whole process

Dear Firends

I have a request as below:

If there are emails meet my filter condition, then move on with my original following process

If there isn’t any email meet my filter condition, then the whole process need to be stop(Because there is no email for the process to handle)

May I know which activity should I use for this request?

Thank you for your kind guidance as always

Regards
Ivan

1 Like

Hi @yangyq10

Take an If condition to check the filter condition, if conditions met then insert the activities in then block to move forward with the process, in else block don’t keep any activities.

If the condition doesn’t then the bot will go to Else block and there is no activities right, then the process will stop automatically.

Hope you understand!!

Hi @mkankatala

You can use Throw activity. It will throw the exception. (if you are using RE Framework) Connect business exception link to end process & will end the process.

Or simply you can use if condition. If condition match then whole process in Then process. Keep else block blank.

Thanks

you are checking if the count is >0 and then only proceeding right …whatever you are doing now is fine if no mail found it will end

Thank you for the guidance, I got it now

1 Like

Thank you for the idea, it works!

It’s my pleasure… @yangyq10

Happy Automation!!

I am sooooo sorry, I just find out even though I put nothing in [Else], the whole process will keep moving to the next step but not end the whole process

I try put [Kill Process] in [Else] but it just kill outlook but keep moving to next step(SAP relative operation)

PS: The reason it work previoulsy is that I only test this part of process but not the the process as a whole

1 Like

so everything is inside for loop right .you can use break to exit from the loop

Thanks for the feedback. I try [break] but it told me it only apply in a loop[For each, while]. My process is a sequence thus it can’t be used on it

yeah…you should keep all the activities you are performing inside if itself then

But it seems my condition is not good for a loop. My scenario is to check if the email volume I need is bigger than zero, if yes, then move on. If no, then stop the whole process

you have mentioned SAP relsted operations right…that also you may need to keep inside if loop

Lak, I use [Terminate Workflow] and seems it works

yours is an attended automation?

Sorry that I am a beginner of UiPath, may I know what is attended automation?

if you are using terminate wf a pop up will come and you will have to manually close it right. That means a human intervention is required here. So it is not recommended to use this