Support Portal

for ProcessRobot and WinAutomation

Start a new topic

Logical AND/OR operator in IF conditions

ADMIN

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


waj
waj

2 people like this idea

Does this work with Case Statements?

ADMIN

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 ?

ADMIN

Hello Joseph,


You could write it like that:


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

Operator: =

Second Operand: True

Peter,

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 ?

ADMIN

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. 

Login or Signup to post a comment