Send Error email after Robot fails 5 times

Hi,

At the moment,

My solution does a try catch and if it fails it sends an email.

Is it possible to send an email only after it fails 5 times, instead of every time?

Thanks,
Shawn

1 Like

Hi @shawnmurray

You can check this out for your reference.

cheers :smiley:

Happy learning :smiley:

2 Likes

Hi @shawnmurray,

use counter as activity to count error and in IF activity apply requirements:
IF
variable = 5 then send email

1 Like

@shawnmurray - Yes it is possible and it is easy.
Follow these steps:

  1. Create a variable count initialize it to zero.
  2. Create a Boolean variable exception_process and set it to False.
  3. Create a Sequence then use Try Catch in it. All the steps will be in Try Block and make sure to set Boolean False and increase the count by 1. Now in Catch block set the Boolean true.
  4. Next step in Flow Decision use the condition exception_process And count<=5.If the condition is true then move to 3rd step. If False then move to the next step.
  5. In the next step, it will check whether the boolean is true/false if boolean is True then send the mail otherwise carry on with the next step.

I know it looks like a big process but it is not and interesting.

Best!!
Anmol

1 Like

@pattyricarte

Thanks for the response.

Would doing this not send the email every time it fails or can i put the email outside the retry scope to send?

In RetryScope loop use error counter in IF activity.

Otherwise the loop will send mail every time

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.