Skip to main content

Overview

This reference documents all available operators in the Rules engine, organized by category. Each operator includes syntax, parameters, and practical examples.
Quick search tip: Use Ctrl+F (or Cmd+F on Mac) to search for specific operators on this page.

Math Operations

Perform arithmetic calculations and number formatting.

Basic Arithmetic

Add two or more numbers together.Syntax:
Example:
Subtract the second number from the first.Syntax:
Example:
Multiply two or more numbers.Syntax:
Example:
Divide the first number by the second.Syntax:
Example:
Raise the first number to the power of the second.Syntax:
Example:
Get the remainder after division.Syntax:
Example:

Rounding & Formatting

Round a number to the nearest whole number.Syntax:
Example:
Round up to the nearest integer.Syntax:
Example:
Round down to the nearest integer.Syntax:
Example:
Remove decimal part, keeping only the integer.Syntax:
Example:
Format a number to a specific number of decimal places.Syntax:
Example:
Format a number according to locale settings.Syntax:
Example:

Advanced Math

Find the smallest value from a list of numbers.Syntax:
Example:
Find the largest value from a list of numbers.Syntax:
Example:
Calculate the natural logarithm (base e).Syntax:
Example:
Calculate logarithm with a specified base.Syntax:
Example:
Returns Euler’s number (approximately 2.718).Syntax:
Example:

Big Number Operations

For high-precision calculations that avoid floating-point errors.
Add numbers with arbitrary precision.Syntax:
Example:
Subtract numbers with arbitrary precision.Syntax:
Multiply numbers with arbitrary precision.Syntax:
Divide numbers with arbitrary precision.Syntax:

Comparison Operations

Compare values to make decisions.
Check if two values are equal.Syntax:
Example:
Check if two values are not equal.Syntax:
Example:
Check if first value is greater than second.Syntax:
Example:
Check if first value is greater than or equal to second.Syntax:
Example:
Check if first value is less than second.Syntax:
Example:
Check if first value is less than or equal to second.Syntax:
Example:
Check if a value falls within a range.Syntax:
Parameters:
  • value - The value to check
  • min - Minimum value
  • max - Maximum value
  • inclusivity (optional) - One of:
    • "INCLUSIVE" (default) - Both boundaries included
    • "EXCLUSIVE" - Both boundaries excluded
    • "INCLUSIVE_LEFT" - Only left boundary included
    • "EXCLUSIVE_LEFT" - Only left boundary excluded
    • "INCLUSIVE_RIGHT" - Only right boundary included
    • "EXCLUSIVE_RIGHT" - Only right boundary excluded
Examples:
Check if a value falls outside a range.Syntax:
Example:

Logic Operations

Combine conditions with boolean logic.
Check if all conditions are true.Syntax:
Example:
Check if any condition is true.Syntax:
Example:
Invert a boolean value or an array of boolean values.Syntax:
Example:
Check if a value is empty, null, or undefined.Syntax:
Example:
Check if a value has content.Syntax:
Example:

String Operations

Manipulate and search text.
Join multiple strings together. A space is included after the join automaticallySyntax:
Example:
Join values with commas.Syntax:
Example:
Extract part of a string.Syntax:
Example:
Replace placeholders in a template string.Syntax:
Example:
Split a string into an array using a delimiter.Syntax:
Example:
Check if string starts with a specific prefix.Syntax:
Example:
Check if string ends with a specific suffix.Syntax:
Example:
Check if string contains a substring.Syntax:
Example:
Check if string does not contain a substring.Syntax:
Example:
Extract text using regular expression patterns. Returns the first captured group or the entire match if no groups are defined.Syntax:
Parameters:
  • string - The text to search
  • pattern - Regular expression pattern (use \\ to escape backslashes in JSON)
Examples:Extract year from date:
Extract email domain:
Extract phone area code:
Validate and extract:
Common patterns:
  • \\d - Any digit (0-9)
  • \\w - Any word character (a-z, A-Z, 0-9, _)
  • \\s - Any whitespace
  • . - Any character
  • + - One or more
  • * - Zero or more
  • ^ - Start of string
  • $ - End of string
  • () - Capture group
Note: Remember to escape backslashes in JSON strings (use \\d not \d)

Array Operations

Work with lists and collections.
Check if an array includes a specific value.Syntax:
Example:
Check if an array does not include a specific value.Syntax:
Check if a value exists in an array (same as arrayContains, different parameter order).Syntax:
Example:
Check if a value does not exist in an array.Syntax:
Merge multiple arrays into one.Syntax:
Example:
Create an array from condition/value pairs, including only items where condition is true.Syntax:
Example:
Sort an array of numbers in ascending order or sort an array of strings in alphabetical orderSyntax:
Example: Sort numbers
Example: Sort strings
Filter an array using a boolean mask array.Syntax:
Example:

Set Operations

Perform mathematical set operations on arrays.
Check if first array is a subset of second array.Syntax:
Example:
Check if first array is not a subset of second array.Syntax:
Combine two arrays, removing duplicates.Syntax:
Example:
Find common elements between two arrays.Syntax:
Example:
Find elements in first array that are not in second array.Syntax:
Example:

Lookup & Mapping

Map values and check membership.
Map a key to a value using a lookup object, with optional default.Syntax:
Example:
Check if a value exists in an options list.Syntax:
Example:
Check if value exists in array or object keys.Syntax:
Check if value doesn’t exist in array or object keys.Syntax:

Date Operations

Work with dates and times.
Get today’s date (without time).Syntax:
Example:
Get current date and time.Syntax:
Get current Unix timestamp.Syntax:
Add days, months, or years to a date.Syntax:
Example:
Subtract days, months, or years from a date.Syntax:
Calculate difference between two dates.Syntax:
Example:
Format a date as a string.Syntax:
Example:
Convert date to ISO 8601 string.Syntax:

JSON Operations

Parse and query JSON data.
Convert JSON string to object.Syntax:
Example:
Convert object to JSON string.Syntax:
Example:
Query JSON data using JSONPath syntax.Syntax:
Example:
With delimiter for joining results:

System Operations

Special system-level operations.
Explicitly reference a fact (usually @fact: syntax is used instead).Syntax:
Evaluate a mathematical expression (advanced use).Syntax:

What’s Next?

Rule Patterns

Learn common patterns for using these operators effectively

Examples Library

See real-world examples using multiple operators together

Core Concepts

Understand how operators fit into the bigger picture

Getting Started

Build your first rule with step-by-step guidance
Need Help? Visit our Help Center or join the Community for support.