LogoLogo
API Documentation
Current Version
Current Version
  • DecisionRules Documentation
  • DecisionRules Academy
  • API
    • API Introduction
    • API Keys
      • Solver API Keys
      • Management API keys
      • BI API keys
    • Rule Solver API
    • Management API
      • Rule Migration Strategies
      • 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)
  • AI Assistant
    • About Assistant
    • Assistant Setup
      • Gemini Assistant
  • RULES
    • Rules Introduction
    • Rule List
    • Rule Mode
    • Common Rule Features
      • Input & Output Model
        • Simple Editor
        • JSON Editor
      • Test Bench
      • Rule Alias
      • Rule State
      • Versioning
      • Rule Variables
      • Execution Strategy
      • Rule Dependencies
      • Rule Export & Import
        • Rule Export
        • Rule Import
        • Managing Decision Table in Excel/Google Sheets
        • Deprecated Formats: XLSX v.1 and CSV
      • Tags
      • Rule Comparison
        • Decision Table Comparison
        • Decision Tree Comparison
        • Scripting Rule Comparison
      • Rule Lock
      • Teamwork Indicator
      • Event Timeline
    • Data Types & Functions
      • 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
    • Decision Table
      • Table Designer
        • Table Operations
          • Filter Values
          • Valid Values
          • Sorting
      • Binding to Model
    • Decision Tree
      • Tree Designer
    • Workflow
      • Workflow Designer
      • Workflow Nodes Overview
      • Workflow Limits
    • Scripting Rule
      • Custom functions in Scripting Rules
      • Calling external API within ScriptingRules
      • Use Rule Variables in Scripting Rules
      • Call Embedded Rules in Scripting Rules
      • Tips
    • Rule Flow
      • Rule Flow Designer
      • Rule Flow Mapping
      • Rule States in Rule Flow
      • Warnings & Errors
      • Rule Flow Limits
  • SPACE
    • Space Introduction
    • Space Info
    • Dashboard
    • Access
    • API Keys
    • Audit Logs
  • Organization
    • Organization Introduction
    • Organization List
    • Members
    • Teams
    • Spaces
    • Space Roles
    • Policies
    • Statistics
    • Settings
  • Profile
    • Profile Introduction
    • General
    • Dashboard
    • Plans
    • Add-ons
    • Limits
      • Plan Limits Explained
    • Subscriptions
    • Invoices
  • Access
    • Sign Up & Login
    • Invitations & Permissions
    • Single Sign-On (SSO)
  • Business Intelligence
    • Audit Logs
    • Power BI Connectivity
      • 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
  • OTHER DEPLOYMENT OPTIONS
    • Regional Cloud
      • Region Specific API URLs
    • Docker & On-Premise
      • Environment Variables
      • Redis Connection Modes
      • DecisionRules Application
        • Minimal Requirements
        • DecisionRules Server
        • DecisionRules Client
        • DecisionRules Business Intelligence
        • Networking Between Docker Containers
      • Setup Single Sign-On (SSO)
        • Set up Microsoft Entra ID SSO
        • Set up Google SSO
      • 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
      • White Labeling
  • 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
  • Terms & Conditions
    • Terms and Conditions
    • Privacy Policy
    • Service Level Agreement
      • Community Support
      • Standard Cloud (SaaS)
      • Silver SLA
      • Gold SLA
      • Custom SLA
    • Sub-Processor List
  • Product Updates
    • Release Notes
      • Public Cloud
      • On-Premise / Private Cloud
    • Major Updates
      • Changes in Version 1.19.0 (10/2024)
      • Changes in Version 1.20.0 (4/2025)
    • Roadmap
Powered by GitBook
On this page
  • List of text functions
  • Concatenation (CONCAT)
  • Concatenation with a separator (CONCAT_WS)
  • Length (LEN)
  • Upper case (UPPER_CASE)
  • Lower case (LOWER_CASE)
  • Left (LEFT)
  • Right (RIGHT)
  • Trim (TRIM)
  • Trim left (TRIM_LEFT)
  • Trim right (TRIM_RIGHT)
  • Substring (SUBSTR)
  • Regular expression (RE)
  • Test (TEST)
  • Match (MATCH)
  • Replace (REPLACE)
  • Split (SPLIT)
  • String format (STRINGFORMAT) (deprecated)

Was this helpful?

  1. RULES
  2. Data Types & Functions
  3. Operators and Functions
  4. Functions

Text Functions

List of text functions

  • CONCAT

  • CONCAT_WS

  • LEN

  • UPPER_CASE

  • LOWER_CASE

  • LEFT

  • RIGHT

  • TRIM

  • TRIM_LEFT

  • TRIM_RIGHT

  • SUBSTR

  • RE

  • TEST

  • MATCH

  • REPLACE

  • SPLIT

Deprecated functions

  • STRINGFORMAT

Concatenation (CONCAT)

Adds two or more strings together.

  • Takes at least 1 argument.

  • All arguments must be strings, numbers, variables or alternatively arrays.

input = "week"

[function] --> [output]

CONCAT("pine","apple")      --> "pineapple"
CONCAT("he","ll","o")       --> "hello"
CONCAT(1,2)                 --> 12
CONCAT({input},"end")       --> "weekend"
CONCAT(1+1,"nd")            --> "2nd"
CONCAT(["a","b","c"])       --> "abc"

CONCAT()                    --> invalid

Concatenation with a separator (CONCAT_WS)

Adds two or more strings together with a separator.

  • Takes at least 2 arguments.

  • The first argument specifies the separator.

  • The other arguments are the values to be concatenated.

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

  • All arguments except the first one can also take arrays.

input = "week"

[function] --> [output]

CONCAT("-","pine","apple")      --> "pine-apple"
CONCAT_WS("+","he","ll","o")    --> "he+ll+o"
CONCAT_WS("_"1,2)               --> 1_2
CONCAT_WS(" ",{input},"end")    --> "week end"
CONCAT_WS("^",1+1,"nd")         --> "2^nd"
CONCAT_WS("separator","word")   --> "word"
CONCAT_WS("!",["a","b","c"])    --> "a!b!c"

CONCAT_WS()                     --> invalid

Length (LEN)

Returns the length of a string.

  • Takes 1 argument.

  • The argument has to be a string, number, or a variable.

[function] --> [output]

LEN("Hello")       --> 5
LEN("555")         --> 3
LEN(555)           --> 3

LEN("Hello", "bye")    --> invalid

Upper case (UPPER_CASE)

Converts a string to the upper case.

  • Takes 1 argument.

  • The argument has to be a string or a variable.

[function] --> [output]

UPPER_CASE("Hello World")       --> "HELLO WORLD"
UPPER_CASE("I AM NEW HERE")     --> "I AM NEW HERE"
UPPER_CASE("2ae3")              --> "2AE3"

UPPER_CASE("Hello", "World")       --> invalid

Lower case (LOWER_CASE)

Converts a string to the lower case.

  • Takes 1 argument.

  • The argument has to be a string or a variable.

[function] --> [output]

LOWER_CASE("Hello World")       --> "hello world"
LOWER_CASE("I AM NEW HERE")     --> "i am here"
LOWER_CASE("2AE3")              --> "2ae3"

UPPER_CASE("Hello", "World")       --> invalid

Left (LEFT)

Returns the first character of a string or the specified number of characters from the beginning.

  • Takes 1 or 2 arguments.

  • The first argument has to be a string, number or a variable.

  • The second optional argument specifies the number of characters to be taken from the left side. If not specified, it defaults to 1.

input = "123"

[function] --> [output]

LEFT("abcd")           --> "a"
LEFT("")               --> ""
LEFT("abcd",2)         --> "ab"
LEFT({input},2)        --> "12"

Right (RIGHT)

Returns the last character of a string or the specified number of characters from the end.

  • Takes 1 or 2 arguments.

  • The first argument has to be a string, number or a variable.

  • The second optional argument specifies the number of characters to be taken from the right side. If not specified, it defaults to 1.

input = "123"

[function] --> [output]

RIGHT("abcd")           --> "d"
RIGHT("")               --> ""
RIGHT("abcd",2)         --> "cd"
RIGHT({input},2)        --> "23"

Trim (TRIM)

Trims leading and trailing spaces in a string.

  • Takes 1 argument.

  • The argument has to be a string, number or a variable.

input = "  123  "

[function] --> [output]

TRIM("   abcd   ")       --> "abcd"
TRIM("")                 --> ""
TRIM("abcd")             --> "abcd"
TRIM({input})            --> "123"

Trim left (TRIM_LEFT)

Trims leading spaces in a string.

  • Takes 1 argument.

  • The argument has to be a string, number or a variable.

input = "  123"
[function] --> [output]

TRIM_LEFT("   abcd")          --> "abcd"
TRIM_LEFT("   abcd   ")       --> "abcd   "
TRIM_LEFT("")                 --> ""
TRIM_LEFT({input})            --> "123"

Trim right (TRIM_RIGHT)

Trims trailing spaces in a string.

  • Takes 1 argument.

  • The argument has to be a string, number or a variable.

VARIABLE = "123  "
[function] --> [output]

TRIM_RIGHT("abcd   ")              --> "abcd"
TRIM_RIGHT("abcd")                 --> "abcd"
TRIM_RIGHT("")                     --> ""
TRIM_RIGHT({VARIABLE})             --> "123"

Substring (SUBSTR)

Returns a substring from a specified position of a string.

  • Takes 2 or 3 arguments.

  • The first argument has to be a string or a variable.

  • The second argument is the index of the first character to appear in the substring

  • The third, optional argument is the index of the last character to appear in the substring

  • The second and third argument has to be a number or a variable.

  • If the third argument is not provided, the substring spans till the end of the original string.

[function] --> [output]

SUBSTR("ab123ABCD",3,5)          --> 123
SUBSTR("ab123ABCD",6,6)          --> "A"
SUBSTR("ab123ABCD",0,5)          --> "ab123"
SUBSTR("ab123ABCD",3)            --> "123ABCD"

SUBSTR("ab123ABCD")              --> invalid

Regular expression (RE)

Builds a regular expression for use in other text functions (TEST, MATCH, REPLACE, SPLIT).

  • Takes 1 or 2 arguments.

  • The first argument is a string representation of the regular expression.

  • The second optional argument is a string representation of custom flags.

[function] --> [output]

RE("[A-Z]")        --> /[A-Z]/
RE("[A-Z]","g")    --> /[A-Z]/g

Test (TEST)

Tests a string for a match against a regular expression and returns true or false.

  • Takes 2 arguments.

  • The first argument specifies to string to be tested.

  • The first argument has to be a string, number or a variable.

  • The second argument specifies the substring whose presence is to be tested.

  • The second argument can take a string or the RE function.

[function] --> [output]

TEST("Hello, World!","ll")             --> true
TEST("Hello, World!","[A-Z]")          --> true
TEST("Hello, World!",RE("l{2}"))       --> true
TEST("Hello, World!",RE("l{3}"))       --> false
TEST("Hello, World!",RE("H[ae]llo"))   --> true
TEST("Hello, World!",RE("h[ae]llo"))   --> false

Match (MATCH)

Tests a string for a match against a regular expression and returns an array of matches (or null for no matches).

  • Takes 2 arguments.

  • The first argument specifies to string to be tested for matches.

  • The first argument has to be a string, number or a variable.

  • The second argument specifies the regular expression to be used for the matching.

  • The second argument can take a string or the RE function.

  • When the second argument is given as a plain string, the match is performed with the g (global) flag.

[function] --> [output]

MATCH("Hello, World!","ll")             --> ["ll"]
MATCH("Hello, World!","[A-Z]")          --> ["H","W"]
MATCH("Hello, World!",RE("[A-Z]"))      --> ["H"]
MATCH("Hello, World!",RE("[A-Z]","g"))  --> ["H","W"]
MATCH("Hello, World!",RE("l{3}"))       --> null
MATCH("Hello, World!",RE("h[ae]llo"))   --> null

Replace (REPLACE)

Takes a string, matches it against a regular expression and replaces the matches with a given replacement string.

  • Takes 3 arguments.

  • The first argument specifies to string to be tested for matches.

  • The first argument has to be a string, number or a variable.

  • The second argument specifies the regular expression to be used for the matching.

  • The second argument can take a string or the RE function.

  • When the second argument is given as a plain string, the match is performed with the g (global) flag.

  • The third argument specifies the replacement string.

Argument 1 --> where to replace

Argument 2 --> what to replace

Argument 3 --> for what to replace

[function] --> [output]

REPLACE("Hello World", "o", "a")                    --> "Hella warld"
REPLACE("Hello, World!", "ll", "zz")                --> "Hezzo, World!"
REPLACE("Hello, World!", RE("[A-Z]","g"), "X")      --> "Xello, Xorld!"
REPLACE("John Smith", RE("(\w+)\s(\w+)"), "$2, $1") --> "Smith, John"

Split (SPLIT)

Takes a string, matches it against a regular expression and splits it into an array of strings.

  • Takes 2 arguments.

  • The first argument specifies to string to be tested for matches.

  • The first argument has to be a string, number or a variable.

  • The second argument specifies the regular expression to be used for the matching.

  • The second argument can take a string or the RE function.

  • When the second argument is given as a plain string, the match is performed with the g (global) flag.

[function] --> [output]

SPLIT("Hello, World!", "ll")                --> ["He","o, World!"]
SPLIT("Hello, World!", "l{2}")              --> ["He","o, World!"]
SPLIT("Hello, World!", RE("[A-Z]","g"))     --> ["","ello, ","orld!"]

String format (STRINGFORMAT) (deprecated)

This function is deprecated. Use plain text with variables instead.

Includes variables into a string.

  • Must have 1 argument, the string with variables to include.

input = "hi"

[function] --> [output]

STRINGFORMAT("Hello,World")             --> "Hello,World"
STRINGFORMAT("1, 2")                    --> 1 2
STRINGFORMAT("{INPUT}bye")              --> "hiby"
STRINGFORMAT("Hello")                   --> "Hello"
STRINGFORMAT("ha he")                   --> "ha he"

Last updated 7 months ago

Was this helpful?