OrElse shortcircuits

Hi

We have experienced issues using the OrElse operator i UiPath. It shortcircuits due to an error in the OrElse.To put it simply if the part of the statement right of the “OrElse”-operator causes an exception it is thrown even though the left part is false and should be evaluated.
We can work around it, but it looks like a bug.

Have anybody else encountered this behaviour?

Best regards Mikkel

Hi @Yumwzsch, it is working as expected for me.
For ORELSE, if the first condition is true then it won’t check the second condition. However, if the first condition is false then the second condition will be checked.
For OR, it will check both the conditions.

1 Like

I get that too, most times, but in some cases (if i have an empty string that i try to parse to a date) in the last part the exception is thrown due to UiPath precompiling the entire statement before calculating the OrElse-statement.

Which means that even though the last part is never reached it is compiled and therefore exceptions can be thrown.

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