How to use Retry Scope activities

Hi Guys,
Please guide how to use Retry Scope Activities.
I am not getting which activities accept in Condition .

Thanks,
Udaykumar

Retries the contained activities as long as the condition is not met or an error is thrown.

https://www.uipath.com/activities-guide/retry-scope

hi @badita

I have gone through activity guide but in condition in retry scope what activities we can use to pass condition because we are not able to pass condition because no activities are able to drag in condition area.

Regards…!!

2 Likes

What condition do you actually need?
There are activities like “Element exists” that can be used in Retry scope (because they have a boolean result).

Adrian.

1 Like

hi @adrian

Suppose if i am using Some condition and assigned a Boolean value to that variable then how can i use that as a condition here.

Regards…!!

Hi,

You can use any Activity<bool> (activity that has a boolean result, like @adrian mentioned).

If you’re storing a check variable from something else, you can use Microsoft.Activities.Expressions.IsTrue or IsFalse activities in the Condition segment of the RetryScope. Added bonus is you can put any expression there, just like you’d use a normal If.

Regards.

Edit: formatting - <bool> got swallowed, surrounded with code tags.

8 Likes

Hey @andrzej.kniola

Got it.

Thanks

Regards…!!
Aksh

Hi,

In my scenario I want to extract the text from a webpage. As maximum time webpage is not loaded and i am getting Blank value.
Can I use this activity? If yes how can I frame the condition?

I already tried with element exist activity. But it is not working as element is exist thete but data is taking some time to populate.

Thanks in advance…!!

1 Like

Have you tried with “wait for ready” property to “complete” or with delays?

I have tried this…but this is not working in my scenario.

any sample url?

Sorry again for waking up old threads.
Is there any way to write own exception or log message when retry has done three times and not solved. Because on my workflow there are many places that i use retry scope because it needs to find many elements before it continues. So there would be nice to have info where it failed.

You may check ContinueOnError and store the result of retry attempt to some Boolean variable. After the Retry scope, you can throw BusinessRuleException as needed :slightly_smiling_face:

1 Like

i encountered a siimilar problem and resolved it by changing the ‘Options’ - NumberOfRetries to a bigger number (say 20) and then retry interval to 10 seconds. For the action I use Find element activity and in the condition I use the ElementExists activity. Both the activities have same selector (in your case could be the text of interest). Hope that helps.

Hmm… I dont have Microsoft.Activities.Expressions.IsTrue available.
I am trying to use the condition “Path exist” which is a UiPath activity that returns true or false. Why cant this be used as a condition? How else do I retry Scope until I know a file was saved?

1 Like

IsTrue is under Workflow Manager Activities (I think :slight_smile: )

PathExists is not an Activity<bool> (generic version), it’s just a regular activity with an OutArgument<bool>. Since RetryScope only accepts Activity<bool> it cannot be used there, unfortunately.

@Cosmin_Ion_Nicolae - do you think PathExists could be obsoleted and replaced with a generic version in a future update? It only returns a bool, so functionality would remain the same, but right now it’s setup differently from other *Exists activities.

3 Likes

You can surround everything in the retry scope with a try catch, and in the catch you append to a variable holding all error messages. In the end of try (i.e. if there were no error) you set this variable to be the empty string, and the condition for the retry scope should thus be that this string is empty. Set continueOnError=True for the retry scope, and after retry scope you use a check true activity for that the string is empty, with you custom error message in the optional text field if this condition is not met. This way you get the history of all attempts if the retry scope has failed.

There is no such thing… :confused: There is only check false but it does not work inside the condition

This worked for me. Thanks!

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