Retry Scope - Condition Block

Hello.

Why even if UiPath Academy says we can use File exist and Find Element activities in Condition block but when I try it in Studio, it doesn’t let me add those activities.

I wanted to use File Exist for download process but I couldn’t add this activity in Condition block. I also tried to use Retry scope in Use App/Browser activity but it still didn’t work. Do you know why?

Hey @Sekoleyte

Yes, it’s true — File Exists and Find Element can be used in condition logic — but not directly as activities inside an If or Retry Scope condition block. The confusion is likely because:

  • Those activities are not “expressions” — they are activities that return values (e.g., a Boolean for File Exists, or a UIElement for Find Element).
  • In If, While, or Retry Scope conditions, UiPath expects a Boolean expression, not an activity.

You’re likely trying to drag File Exists or Find Element directly into the Condition property of a Retry Scope or If activity. But those properties don’t accept full activities, they expect a Boolean expression like fileFound = True.

:small_orange_diamond: For File Exists:

  1. Use the File Exists activity before the If or Retry Scope condition.
  2. Store the result in a Boolean variable, e.g., fileFound.
  3. Then in your If or Retry Scope, use fileFound as the condition.

cheers

@singh_sumit Yes, I already did it like you explained but why UiPath academy says opposite. I thought maybe there were another way to do it but I don’t know yet. Even UiPath academy gives wrong information about this :confused:

UiPath Academy often teaches best practices based on more generalized workflows, but the platform evolves, and sometimes certain details get lost in the updates or new versions. The idea behind their instructions was likely meant to demonstrate how you can work with Boolean expressions

The activities that can be used directly as a condition for RetryScope must have a return type of Bool, not just an OutArgument<bool>. It’s an implementation detail that throws it off (IIRC the “old” versions of the *Exists would work there, but the new ones don’t).

And yes, the Academy is wrong here, and you’re correct.

1 Like

Yes, you’re right. And another thing that I noticed

image

They say “if the condition is checked and is False, then there will be another retry.”, but it also doesn’t work like this. When the condition is False for Business Rule Exception, it behaves as if an error is thrown. Look at that, I’m getting different exceptions for condition block and check the results.

1st case for Business Rule Exception:

2nd case after i click on step into:

As you’ve seen, When the Value is False, it didn’t jump to Condition block and retried the Action block again as if an error is thrown. But indeed there was not a throw here.

And then I also checked if condition is True case for System Exception.

1st case for System Exception:

2nd case after i click on step into:

As you’ve seen, it jumped to condition block and checked if it’s true like we expected because there was not a throw here for System exception as well.

Probably, it’s the same scenario. It doesn’t work like the academy said.

Thanks for the explanation.

@Sekoleyte so if you are satisfied kindly close this as my as solution.

I’ve already done it before your reply :wink:

1 Like

This seems to be a bug of Studio debugger.
It only stops at the CheckTrue activity in the Condition block in case the CheckTrue expression gives true.

In case the CheckTrue expression gives false it retries immediatelly.

Cheers

1 Like

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