Logical expressions
- && or and for "and"
- || or or for "or"
- ! or not for "not"
The operators && and || can be used between literal values, identifiers, functions or expressions. If an expression can be interpreted as an assignment expression, it should be in parentheses. For example, string1 = "Hello " && string2 = "World!" is interpreted as an assignment expression for the identifier string1. A valid logical expression would be either (string1 = "Hello ") && (string2 = "World!") or string1 == "Hello " && string2 == "World!".
The operators ! and not can be followed directly by a literal value, an identifier or a function, or by an expression in parentheses.
customer.status.defined && customer.status.enabled
customer.birthday.defined || customer.age.defined
itemId == 1 and itemQuantity > 0
itemQuantity < 10 or itemPrice < 5
!customer.credentials.activated
!contains(customer.name, 'Dr')
!(customer.id == order.cust_id)
not(customer.id == order.cust_id)
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!