Support Portal

for ProcessRobot and WinAutomation

Start a new topic

Logical AND/OR operator in IF conditions


The AND "&&" operator can be used inside an "If" condition using the following format

First Operand: %TextVar_1 == "ABC" && TextVar_2 == "DEF"%

Operator: =

Second Operand: True

The OR "||" operator can be used in a similar way

First Operand: %TextVar_1 == "ABC" || TextVar_2 == "DEF"%

Operator: =

Second Operand: True


2 people like this idea

Does this work with Case Statements?


Hello Jaye, it does work.

You can put the "First Operand" in the Switch Action and then "True" or "False" in the Case Action.

Hello Peter,

I think that remember that there was a way in the Multiple OR and Multiple AND syntax for IF statement action to specify, NOT conditions, but I can not remember the syntax.

If this is possible to work, can you paste an example of the syntax with Multiple OR, AND syntax  here ?


Hello Joseph,

You could write it like that:

First Operand: %TextVar_1 == "ABC" && TextVar_2 == "DEF" || TextVar_3 == "DEF" %

Operator: =

Second Operand: True


Actually, I was wondering if there is a "NOT =="  Operator that could be combined within the Multiple AND,  syntax

1 person likes this

%TextVar_1 == "Suzuki" && TextVar_2 == "Honda" && TextVar_3 != "BMW" %

1 person likes this

thanks, yoko, that was the syntax that I had forgotten:  "  !=  "

1 person likes this

What if i want to use Logical AND/OR operator in "IF Web Page Contains ..." 

what shal i do ?


Hello Yassin, you could add multiple CSS selectors in the Controls Repository. The Robot will search for the element using the selectors one by one, from top to bottom. 

What if I want to use "Starts with" instead of "==" or "!=" how do I do that?

I've tried the following but WA doesn't accept it:


%TextVar Starts with "ABC" || TextVar Starts with "DEF"%



The option you asking about is not supported.

I suggest you the regular expression with the Parse Text Action ....

Parse Text - Options: Check -Regular Expression, Check - "Find First Occurrence only"
Text: %TextVar%
Find Text:   ^ABC | ^DEF

If %TextVar_Position%  >= 0

    ....   It starts with ABC  OR Starts with DEF


    .....  Starts with other
End If

Login or Signup to post a comment