Skip to main content

Logical Operators

Operators for combining boolean expressions.

And

Returns true only if ALL conditions are true.

PropertyValue
CategoryLogical Operators
Min Arguments2
Returnsboolean

Arguments:

#NameTypeDescription
0+Boolean ExpressionbooleanConditions to evaluate

Description: All statements must be true for the expression to evaluate as true.

Example:

And(IsActive, IsVerified) → true only if both are true
And(Amount > 0, Amount < 10000, IsApproved) → all three must be true

Truth Table:

ABAnd(A, B)
truetruetrue
truefalsefalse
falsetruefalse
falsefalsefalse

Or

Returns true if ANY condition is true.

PropertyValue
CategoryLogical Operators
Min Arguments2
Returnsboolean

Arguments:

#NameTypeDescription
0+Boolean ExpressionbooleanConditions to evaluate

Description: At least one statement must be true for the expression to evaluate as true.

Example:

Or(IsAdmin, IsOwner) → true if either is true
Or(Status = "New", Status = "Pending") → true for either status

Truth Table:

ABOr(A, B)
truetruetrue
truefalsetrue
falsetruetrue
falsefalsefalse

Combining Logical Operators

You can combine And and Or operators to create complex conditions:

Example - Multiple Conditions:

And(
Or(IsAdmin, IsManager),
IsActive,
Not Null(Email)
)

This returns true if:

  • User is either an admin OR a manager, AND
  • User is active, AND
  • User has an email address

Example - Business Rule:

Or(
And(CustomerTier = "Gold", OrderAmount >= 100),
And(CustomerTier = "Platinum", OrderAmount >= 50),
IsVIP
)

This returns true if:

  • Customer is Gold tier with order >= $100, OR
  • Customer is Platinum tier with order >= $50, OR
  • Customer is a VIP

Best Practices

Use Parentheses for Clarity: When combining multiple operators, use parentheses to make the evaluation order clear.

Short-Circuit Evaluation: Both And and Or use short-circuit evaluation—if the result is determined by the first condition(s), subsequent conditions may not be evaluated.

Keep Conditions Readable: Break complex conditions into multiple lines or use intermediate variables for better readability.