Choose where you’d like to start

Logical operators

Overview

Logical operators are typically used with multiple conditions in a criteria.

Each condition returns a boolean value, and the logical operators used to connect the conditions determine the overall boolean value of the criteria.

There are 3 types of logical operators:

  • && (AND) - conditions on both sides must be met.

    The following truth table shows the possible outcomes when you combine two conditions with AND. The table’s left column shows the truth values of the first condition, the top row shows the truth values of the second condition, and each intersection shows the AND outcome.

    ANDTRUEFALSE
    TRUETRUEFALSE
    FALSEFALSEFALSE
  • || (OR) - condition on any one or both sides needs to be met

    The following truth table shows the possible outcomes when you combine two conditions with OR. The table’s left column shows the truth values of the first condition, the top row shows the truth values of the second condition, and each intersection shows the OR outcome.

    ORTRUEFALSE
    TRUETRUETRUE
    FALSETRUEFALSE​
  • ! (NOT) - condition should not be met. Unlike AND and OR conditions, it does not connect two conditions. Instead, it negates(reverses) a single condition.

    The following truth table shows the NOT outcome in the second column, based on the truth value of the condition in first column.

    ConditionNOT
    TrueFalse
    FalseTrue

Examples

As suggested above, there are numerous combinations of conditions and operators that are possible.

Precedence factor

  • The expression within the innermost set of parentheses is processed first, followed by the next deepest, moving outward until all parentheses have been processed.
  • Same logical operators in the expression will be processed left to right.
  • Among logical operators, the order of the precedence is:
    • NOT, AND and OR for all Zoho services, except Zoho Creator
    • NOT, OR and AND for Zoho Creator.
Note: We are working on unifying the order of precedence among Zoho Creator and other Zoho services.

Get Started Now

Execute