Try catch send email when error


#1

Hi,

This should be simple but I need help:

I am trying to send a success email when the process ran successfully or a failed email when it has error.

image

I tried this and put the error email inside catch… but this doesn’t make sense because if there is an error, the robot will send the error email follow by the success email. I just need guide to where I can place the success email. Thanks!

Warm regards,
Lavina


#2

Hey @lavint,

Just put the activities in the try block and in the catch block catch an “Exception” class Exception and assign a flag value to 1.
After that you can use a flow decision to check if flag=1, send the error mail,otherwise the success mail.

I hope i’m clear! :slight_smile:


#3

Hi @Rishabh_Lakhera,

Thanks! I understood it :slight_smile:

Regards,
Lavina


#4

Could you please mark it as a solution?
Thanks a ton :slight_smile:

Regards,
Rishabh


#5

Sure! Thanks :slight_smile: