Solved

Control Rule Operators

  • 14 December 2017
  • 1 reply
  • 10 views

Badge +3

Why does this work

 

Current User (Email)!='user1@s.com'&&Current User (Email)!='user2@s.com'

 

but this doesn't

 

Current User (Email)!='user1@s.com'||Current User (Email)!='user2@s.com'

 

I'm user 2 and the top example allows the control to be enabled for only us but the bottom one does not.  This is a formatting rule for a control on a form.

 

 

Thanks

icon

Best answer by xMikeX 16 December 2017, 00:41

View original

1 reply

Userlevel 5
Badge +12

Hello, 

Nintex rules become active when they are returned a value of true based on their evaluation.  

Logical AND (&&) expr1 && expr2 Returns expr1 if it can be converted to false; otherwise, returns expr2. Thus, when used with Boolean values, && returns true if both operands are true; otherwise, returns false.


Logical OR (||) expr1 || expr2 Returns expr1 if it can be converted to true; otherwise, returns expr2. Thus, when used with Boolean values, || returns true if either operand is true.


So keeping those rules in mind - the first expression using && returns false and the second using || returns true. This is why the first rule keeps the the control enabled and the second does not based on you being user2.


Current User (Email)!='user1@s.com' (TRUE) && Current User (Email)!='user2@s.com'(FALSE) RETURNS false.


Current User (Email)!='user1@s.com' (TRUE) ||Current User (Email)!='user2@s.com' (FALSE) RETURNS true.

Thanks,

Mike

Reply