LogoLogo
API Documentation
Version 1.19.5 and Older
Version 1.19.5 and Older
  • DecisionRules Documentation
  • API
    • API Introduction
    • API Keys
      • Solver API Keys
      • Management API keys
      • BI API keys
    • Rule Solver API
    • Management API
      • Deprecated Endpoints
    • Console Logs API
    • Business Intelligence API
      • Deprecated Endpoints
    • Datacenters & Locations
      • Global Cloud
      • Regional Cloud
    • Apache Kafka Solver API
    • Endpoint Settings
    • Archive
      • Rule Flow Solver API (DEPRECATED)
  • Decision tables
    • Decision Tables Introduction
    • Table Designer
    • Input & Output JSON Model
      • Simple Editor
      • JSON Editor
      • Binding to Model
    • Supported Data Types
    • Operators and Functions
      • Basic operators
      • Date operators
      • Functions
        • Logical Functions
        • Math Functions
        • Date and Time Functions
        • Text Functions
        • Data Functions
        • Array Functions
        • Integration functions
        • Functions and JSON
    • Export & Import of Decision Tables
      • Export Decision Table
      • Import Decision Table
      • File Structure of JSON Format
      • Managing Decision Table in Excel/Google Sheets
      • Deprecated Formats: XLSX v.1 and CSV
    • Table Operations
      • Filter Values
      • Valid Values
      • Sorting
  • Decision Trees
    • Decision Trees Introduction
    • Decision Tree Designer
    • Export & Import Decision Trees
      • Export Decision Tree
      • Import Decision Tree
  • Scripting Rules
    • Scripting Rule Introduction
    • Custom functions in Scripting Rules
    • Calling external API within ScriptingRules
    • Use Rule Variables in Scripting Rules
    • Call Embedded Rules in Scripting Rules
    • Export & Import Scripting Rules
      • Export Scripting Rule
      • Import Scripting Rule
    • Tips
  • Rule Flow
    • Rule Flow Designer
    • Rule Flow Mapping
    • Rule States in Rule Flow
    • Warnings & Errors
    • Rule Flow Limits
    • Export & Import Rule Flows
      • Export Rule Flow
      • Import Rule Flow
  • Workflow
    • Workflow Introduction
    • Workflow Designer
    • Workflow Nodes Overview
    • Workflow Limits
  • Other
    • Rule Alias
    • Execution Strategy
    • Rule State
    • Rule Versioning
    • Favorite Rules
    • Rule Variables
    • Rule Comparison
      • Decision Table Comparison
      • Decision Tree Comparison
      • Scripting Rule Comparison
    • Rule Tags
    • Rule Dependencies
    • Test Bench
    • Single Sign-On (SSO)
    • Event timeline
    • Rule Lock
    • Rule Migration Strategies
    • Changes in Version 1.19.0 (10/2024)
  • Organizations
    • Introduction
      • Access to Organization
    • Structure
      • Organization Roles
      • Members
      • Teams
      • Spaces
      • Space Roles
      • Policies
      • Settings
  • Teamwork
    • Dashboard
    • Folders
    • Spaces
    • Manage Spaces
    • Share Rules Between Spaces
    • Users & Roles
    • Teamwork Indicator
  • SDK and Integrations
    • Languages / Frameworks
      • SQL Server
      • Oracle PL/SQL
      • PostgreSQL
      • JavaScript
      • Java Spring Example
      • PHP Library
      • Python Library
      • .NET Library
      • Google Tag Manager
    • Excel Add-in
  • Business Intelligence
    • Audit Logs
    • Create a Power BI Report
    • Connect Power BI to Business Intelligence API
    • Connecting from Power BI (deprecated)
    • Connect DecisionRules to Power BI Using Our Custom Connector
  • Billing
    • Invoices & Billing
    • Change Product Plan
    • Billing Information
    • Plan Limits Explained
  • Regional Cloud
    • Regional Cloud
    • Region Specific API URLs
  • On-Premise / Docker
    • Environment Variables
    • Redis Connection Modes
    • Setup Single Sign-On (SSO)
      • Set up Microsoft Entra ID SSO
      • Set up Google SSO
    • DecisionRules Application
      • Minimal Requirements
      • DecisionRules Server
      • DecisionRules Client
      • DecisionRules Business Intelligence
      • Networking Between Docker Containers
    • Docker Showcase App
      • Showcase
      • Showcase + Business Intelligence
    • AWS Setup
      • AWS ECS/Fargate
      • Cache - Amazon ElastiCache
    • Microsoft Azure Setup
      • Database - Azure CosmosDB
      • Cache - Azure Cache for Redis
      • Azure Container Apps
    • Azure Red Hat OpenShift
    • Google Kubernetes Engine (GKE)
    • Kubernetes Setup
      • Kubernetes Setup with Business Intelligence
    • Logging options
    • CD/CI Pipelines
      • Azure DevOps CICD Pipelines
      • Using Migration script (old way)
    • Offline License
  • Terms & Conditions
    • Terms and Conditions
    • Privacy Policy
    • Service Level Agreement
      • Community Support
      • Standard Cloud (SaaS)
      • Silver SLA
      • Gold SLA
      • Custom SLA
    • Sub-Processor List
  • Roadmap 🚲 🗺️
  • Release Notes
    • Public Cloud
    • On-Premise / Private Cloud
Powered by GitBook
On this page
  • List of logical functions
  • Equal (EQ)
  • Greater than (GT)
  • Greater than or equal (GTE)
  • Less than (LT)
  • Less than or equal (LTE)
  • Not equal (NE)
  • Between (BTW)
  • Between left open (BTW_LEFT_OPEN)
  • Between right open (BTW_RIGHT_OPEN)
  • And (AND)
  • Or (OR)
  • Is null (IS_NULL)
  • Is not null (IS_NOT_NULL)
  • Negation (NOT)
  • Condition (IF)
  • Regular expression (REGEXP) (deprecated)

Was this helpful?

  1. Decision tables
  2. Operators and Functions
  3. Functions

Logical Functions

List of logical functions

  • EQ

  • GT

  • GTE

  • LT

  • LTE

  • NE

  • BTW

  • NOT_BTW

  • BTW_LEFT_OPEN

  • BTW_RIGHT_OPEN

  • AND

  • OR

  • IS_NULL

  • IS_NOT_NULL

  • IF

  • NOT

The return value of logical functions is always boolean, i.e., true or false, with the exception of IF.

Deprecated functions

  • REGEXP

Equal (EQ)

Returns true if two values are equal to each other, or false otherwise.

  • Takes 2 arguments.

input1 = 3
input2 = [1,3]

[function] --> [output]

EQ(10,10)                     --> true
EQ(10,15)                     --> false
EQ(10,"10")                   --> true
EQ(10,"aa")                   --> false
EQ({input1},3)                --> true
EQ("a","a")                   --> true
EQ([1,3],{input2})            --> true
EQ({"price":10},{"price":11}) --> false

EQ(10)                        --> invalid

Greater than (GT)

Returns true if the first value is greater than the second value, or false otherwise.

  • Takes 2 arguments.

  • Both arguments have to be numbers, variables or strings.

  • When used with strings, it returns true or false based on their alphabetical order.

input = 4

[function] --> [output]

GT(20,10)         --> true
GT(20,20)         --> false
GT({input},3)     --> true
GT("a","a")       --> false
GT("b","a")       --> true

GT(15)            --> invalid

Greater than or equal (GTE)

Returns true if the first value is greater than or equal to the second value, or false otherwise.

  • Takes 2 arguments.

  • Both arguments have to be numbers, variables or strings.

  • When used with strings, it returns true or false based on their alphabetical order.

input = 4

[function] --> [output]

GTE(20,10)         --> true
GTE(20,20)         --> true
GTE({input},3)     --> true
GTE("a","a")       --> true
GTE("b","a")       --> true

GTE(15)            --> invalid

Less than (LT)

Returns true if the first value is lower than the second value.

  • Takes 2 arguments.

  • Both arguments have to be numbers, variables or strings.

  • When used with strings, it returns true or false based on their alphabetical order.

input = 4

[function] --> [output]

LT(10,20)         --> true
LT(10,10)         --> false
LT(3,{input})     --> true
LT("a","a")       --> false
LT("a","b")       --> true

LT(15)            --> invalid

Less than or equal (LTE)

Returns true if the first value is less than or equal to the second value.

  • Takes 2 arguments.

  • Both arguments have to be numbers, variables or strings.

  • When used with strings, it returns true or false based on their alphabetical order.

input = 4

[function] --> [output]

LTE(10,20)         --> true
LTE(20,20)         --> true
LTE(3,{input})     --> true
LTE("a","a")       --> true
LTE("a","b")       --> true

LTE(15)            --> invalid

Not equal (NE)

Returns true if the first value is not equal to the second value.

  • Takes 2 arguments.

input = 2

[function] --> [output]

NE(10,20)         --> true
NE({input},3)     --> true
NE(20,10)         --> true
NE("a","b")       --> true
NE(20,20)         --> false

NE("a")           --> invalid

Between (BTW)

Returns true if the second value is between the first and the third value, meaning in particular that first argument ≤ second argument ≤ third argument.

  • Takes 3 arguments.

input = 12

[function] --> [output]

BTW(10,15,20)         --> true
BTW(10,10,20)         --> true
BTW(10,{input},20)    --> true
BTW("a","f","z")      --> true
BTW(10,8,20)          --> false
BTW(20,10,15)         --> false

BTW(20,10)            --> invalid

Between left open (BTW_LEFT_OPEN)

Returns true if the second value is between the first (excluding) and the third (including) value, meaning in particular that first argument < second argument ≤ third argument.

  • Takes 3 arguments.

Between right open (BTW_RIGHT_OPEN)

Returns true if the second value is between the first (including) and the third (excluding) value, meaning in particular that first argument ≤ second argument < third argument.

  • Takes 3 arguments.

And (AND)

Returns true if all of its arguments evaluate to true.

  • Must have at least 1 argument.

  • Arguments have to be booleans, numbers or variables.

  • If the argument is a number, 0 is evaluated as false and anything else as true.

  • Alternatively, OR can take an array of values in any argument.

input = true

[function] --> [output]

AND(true,EQ(10,10))         --> true
AND(LT(10,10),GTE(10,10))   --> false
AND(true,EQ(10,20))         --> false
AND(true, {input}, false)   --> false
AND([true,true,true])       --> true
AND(1,true)                 --> true

AND("a","b")                --> invalid

Or (OR)

Returns true if at least one of its arguments evaluates to true.

  • Must have at least 1 argument.

  • Arguments have to be booleans, numbers or variables.

  • If the argument is a number, 0 is evaluated as false and anything else as true.

  • Alternatively, OR can take an array of values in any argument.

input = true

[function] --> [output]

OR(false,EQ(10,10))        --> true
OR(LT(10,10),GTE(10,10))   --> true
OR(false,EQ(10,20))        --> false
OR(false, false, {input})  --> true
OR([true,false,false])     --> true
OR(1,true)                 --> true

OR("a","b")                --> invalid

Is null (IS_NULL)

Returns true if the value is null (empty).

  • Must have 1 argument.

input1 = {}
input2 = null
input3 = "null"
input4 = "abc"
input5 = 3

[function] --> [output]

IS_NULL(input1)   --> true
IS_NULL(input2)   --> true
IS_NULL(input3)   --> true
IS_NULL(input4)   --> false
IS_NULL(input5)   --> false

IS_NULL("abc")    --> false
IS_NULL(3)        --> false

Is not null (IS_NOT_NULL)

Returns true if the value is not null (empty).

  • Must have 1 argument.

input1 = {}
input2 = null
input3 = "null"
input4 = "abc"
input5 = 3

[function] --> [output]

IS_NOT_NULL(input1)   --> false
IS_NOT_NULL(input2)   --> false
IS_NOT_NULL(input3)   --> false
IS_NOT_NULL(input4)   --> true
IS_NOT_NULL(input5)   --> true

IS_NOT_NULL("abc")    --> true
IS_NOT_NULL(3)        --> true

Negation (NOT)

Returns the opposite of a boolean value.

  • Must have 1 argument.

input = false

[function] --> [output]

NOT(true)          --> false
NOT({input})       --> true
NOT(LT(1,4))       --> false
NOT(EQ(256,256))   --> false

Condition (IF)

Returns the second argument if the first argument is true, otherwise returns the third argument.

  • Must have 3 arguments.

  • The first argument is a condition. The condition must be of the boolean type (true/false).

  • The second argument is an arbitrary value.

  • The third argument is an arbitrary value.

input = false
number = 8

[function] --> [output]

IF(true,"Input truthy","Input falsy")       --> "Input truthy"
IF({input},"Input truthy","Input falsy")    --> "Input falsy"
IF(LT(0,{number}),"Positive","Negative")    --> "Positive"

Regular expression (REGEXP) (deprecated)

Returns true if the first argument matches against a regular expression in the second argument.

  • Must have 2 arguments.

  • Arguments have to be numbers, strings or variables.

input = hello

[function] --> [output]

REGEXP("abc","bc")       --> true
REGEXP(12233,23)         --> true
REGEXP({input},"lo")     --> true
REGEXP("xxx","yy")       --> false
REGEXP("hello","ho")     --> false

REGEXP("bye")            --> invalid

Was this helpful?

This function is deprecated. Use TEST instead (see ).

Text Functions