IF condition with AND OR statements


#1

Hi Experts

I am currently setting up a process where I need to use an IF activity - the condition contains two conditions where one of them needs to be true in order to continue. However one of the conditions also have two parameters that needs to be true.

Hopefully the following will outline the scenario:

Condition 1:
myValue1 > 0 ANDALSO myValue1 > myValue2

Condition 2:
myValue3 > 0

Can these two conditions be combined in one IF activity with an OR statement? Meaning that at least one of the conditions must be true in order to continue or do I need to create separate IF activities for the two conditions?


#2

@jacchr Try below statement in If condition

(myValue1 > 0 AND myValue1 > myValue2) OR (myValue3 > 0)


#3

@Manjuts90 is very right here, @jacchr see attached workflow -

Main.xaml (5.6 KB)


#4

Thanks!

I used the (myValue1 > 0 ANDALSO myValue1 > myValue2) OR myValue3 > 0 which apparently did not work.

When do you use ANDALSO over AND - and ORELSE over OR?


#5

See this -

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


#6