Choose where you’d like to start

Criteria in conditional statements

Overview

A criteria is required when you need to execute conditional statements like if, else if, and conditional if. Criteria comprises of one or more conditions separated by logical operators

Conditions always evaluate to a boolean value - True or False. The boolean value of the overall criteria will depend on the conditions and the type of Logical Operators used to connect the conditions in the criteria.

If the criteria is met(i.e., it evaluates to true), the tasks specified under the condition will be executed. If not, the tasks will be skipped.

Syntax

A criteria looks like the following snippet:

(<condition_1> <logical_operator_1> <condition_2> <logical_operator_2> ..... <condition_n>)

Each condition in the criteria can look like one of the following:

  • (<expression1> <operator> <expression2>)

            (or)

  • (<function_returning_boolean>)

<expression1>

Expression whose value needs to be compared to a specified value.

<function_returning_boolean>

Functions which return a boolean value.

If the function returns True, the given tasks will be executed. Else, they will be skipped.

<operator>

Operator to compare field/variable/expression value against the specified value. 

<expression2>

It may directly be a value, or an expression evaluating to the required value, which needs to be compared with the specified field/expression. 

Example

This is a sample criteria in the "if" conditional statement:

if ((a > 5) && (b >10) || (c > 20))
{
   <actions_to_be_executed>
}

Applicable operators and expressions for TEXT expressions

The criteria format: <text_expression> <operator> <expression> must be used to specify the following operators.

OperatorApplicable expression
  • ==
  • !=
  • is not
  • TEXT value, or an expression that evaluates to a TEXT value
  • TEXT list
  • is
  • TEXT value, or an expression that evaluates to a TEXT value
  • is not
  • any expression that evaluates to null

It is advisable to use isNull function instead to check null values

  • in
  • not in
  • TEXT list

Applicable operators and expressions for Number and Decimal expressions

The criteria format: <number/decimal_expression> <operator> <expression> must be used to specify the following operators.

OperatorApplicable expression
  • ==
  • !=
  • number/decimal value or an expression that evaluates to a number/decimal value
  • number/decimal list
  • is
  • number/decimal value, or an expression that evaluates to a number/decimal value
  • in
  • not in
  • number/decimal list (or numerical values in quotes)
  • is not
  • null, or any expression that evaluates to null

It is advisable to use isNull function instead to check null values

  • >
  • >=
  • <=
  • number/decimal value, or an expression that evaluates to a number/decimal value

Applicable operators and expressions for DATE-TIME expressions

The criteria format: <datetime_expression> <operator> <expression> must be used to specify the following operators.

OperatorApplicable expression
  • == 
  • !=
  • tomorrow
  • yesterday
  • now
  • today
  • date system variables
  • date/date-time value or an expression that evaluates to a date/date-time value
  • list of date-time values
  • is
  • tomorrow
  • yesterday
  • now
  • today
  • date system variables
  • date/date-time value or an expression that evaluates to a date/date-time value
  • is not
  • null, or any expression that evaluates to null

It is advisable to use this function instead to check null values

  • in
  • not in
  • list of date-time values

Applicable operators and expressions for LIST expressions

The criteria format: <list_expression> <operator> <expression> must be used to specify the following operators.

OperatorApplicable expression
  • ==
  • in
  • a list or an expression that evaluates to a list 

Even if the expression contains any additional elements apart from the specified values, that record will be treated as matching the criteria.

  • !=
  • not in
  • a list or an expression that evaluates to a list 

Note: (Applicable only to Zoho Creator)

  • You can also specify field link name in place of an expression. In such cases, the applicable operators will be based on the data-type of the specified field (as detailed above), except for the Name and Address main fields.
  • For Name and Address main fields, the supported operators and expressions are mentioned below:
    • The criteria format: <field_link_name> <operator> (<expression>) must be used to specify the following operators.

      OperatorApplicable expression
      • ==
      • !=
      • is not
      • null, or any expression that evaluates to null

      It is advisable to use this function instead to check null values

    • ​The criteria format: <field_link_name>.<operator> (<expression>) must be used to specify the following operators.

      OperatorApplicable expression
      • contains
      • TEXT value, or an expression that evaluates to a TEXT value
      • isEmpty

             NA​

  • Field link names cannot be specified when the conditional statement is written in Custom Functions or Custom Schedule Workflows.
  • You can specify fields in the lookup form in the format
    <lookup_field_link_name>.<field_link_name>
    and the applicable operators will be based on the data-type of the specified field, as detailed above.
  • You can specify fields in the Subform in the format
    <subform_field_link_name>.<field_link_name>
    and the applicable operators will be based on the data-type of the specified field, as detailed above.

Related Links

Get Started Now

Execute