On This Page

Operators and Precedence

ProcessMind expressions support a variety of operators for arithmetic calculations, comparisons, and logical operations.

Operators

Arithmetic Operators

Symbol Name Description Example Result
+ Addition Adds two numbers or concatenates strings 5 + 3 8
- Subtraction Subtracts the second number from the first 10 - 4 6
* Multiplication Multiplies two numbers 6 * 7 42
/ Division Divides the first number by the second 15 / 3 5

Comparison Operators

Symbol Name Description Example Result
== Equal Checks whether two values are equal Status == "Active" true or false
!= Not Equal Checks whether two values are not equal Status != "Deleted" true or false
< Less Than Checks whether the first value is less than the second Amount < 100 true or false
> Greater Than Checks whether the first value is greater than the second Amount > 1000 true or false
<= Less Than or Equal Checks whether the first value is less than or equal to the second Count <= 10 true or false
>= Greater Than or Equal Checks whether the first value is greater than or equal to the second Score >= 80 true or false
in In List Checks whether a value is in a list of values Status in ["A", "B", "C"] true or false

Logical Operators

Symbol Name Description Example Result
&& Logical AND Returns true if both conditions are true Amount > 100 && Status == "Active" true or false
and Logical AND (keyword) Alias for &&. Returns true if both conditions are true Amount > 100 and Status == "Active" true or false
|| Logical OR Returns true if at least one condition is true Priority == "High" || Urgent == true true or false
or Logical OR (keyword) Alias for ||. Returns true if at least one condition is true Priority == "High" or Urgent == true true or false
! Logical NOT Negates a boolean value !IsDeleted true or false
not Logical NOT (keyword) Alias for !. Negates a boolean value not IsDeleted true or false

Precedence

Operators with higher precedence are evaluated first. Parentheses can be used to override the default precedence.

Precedence Category Operators Associativity
1 Logical OR || , or Left to right
2 Logical AND && , and Left to right
3 Equality == , != Left to right
4 Comparison < , > , <= , >= , in Left to right
5 Addition/Subtraction + , - Left to right
6 Multiplication/Division * , / Left to right
7 Unary ! , not , - Right to left
8 Function Call () Left to right
9 Parentheses ( )

Operator Notes

  • String concatenation with +: the + operator also concatenates strings when either operand is a string:

    "Hello" + " " + "World""Hello World"
  • The in operator is equivalent to multiple OR comparisons:

    Status in ["Pending", "Active", "Review"]
    // is the same as:
    Status == "Pending" || Status == "Active" || Status == "Review"

Examples

  • Combining conditions:

    // Both conditions must be true
    Amount > 1000 && Region == "Europe"
    
    // At least one condition must be true  
    Priority == "High" or Escalated == true
    
    // Negation
    not IsArchived

Ternary Operator

The ternary operator provides a shorthand for simple if/else logic:

  • Syntax:

    condition ? valueIfTrue : valueIfFalse
  • Example:

    Amount > 1000 ? "High" : "Low"
  • Equivalent to:

    if(Amount > 1000, "High", "Low")

Precedence Examples

  • Without parentheses:

    2 + 3 * 414  (multiplication first)
    10 > 5 && 3 < 7true  (comparisons before AND)
  • With parentheses:

    (2 + 3) * 420  (addition first)

Special Syntax

  • Quoted Identifiers: If a column name contains spaces or special characters, use backticks:

    `Order Amount` * 0.1
    `Customer Name`
    `2024 Revenue`
  • String Escaping: Use backslash to escape special characters in strings:

    "Line 1\nLine 2"     // newline
    "Tab\there"          // tab
    "Say \"Hello\""      // double quote
    "Path\\to\\file"     // backslash
  • Null Values: Use null to represent missing values:

    if(Department == null, "Unknown", Department)

    Or use the isNull() function:

    if(isNull(Department), "Unknown", Department)