Multiple if conditions but without using AND or OR

Hi

Is there a way of using | Pipes in the if conditions?

I would like to use a statement like this,
IF
Str_var = “Side|Front” instead of Str_var = “Side” or Str_var = “Front”

I can get the expression to work in the Matches activities but not in the IF or Flow decisions.

Am I missing something?

@Michaeljep

UiPath was build upon top of .Net framework Vb.Net, so we have to follow Vb.Net operations like below

https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/or-operator

https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/and-operator

I don’t believe using | will allow in UiPath

Mark as solution if this helps

Thanks

1 Like

What you can do is create an array with “Side” and “Front” on which you can check if it contains your variable: Something like {“Side”,“Front”}.contains(Str_var)

@Michaeljep

Please refer this topic

Please mark it as a solution if it solves your query.

Regars,
Krishna C

I feared that the pipe wasn’t useful in these kind of situations, it would just be a whole lot easier when it’s 8-12-15 combinations that has to be checked in the if condition.

I think I’ll go for the array approach and see if that can sort out the conditions a little bit.