Use Journey Optimizer templating language to perform operations on data, such as calculations, data formatting or conversions, conditions, and manipulate them in the context of personalization. Learn personalization syntax guidelines in this page.
➡️ Learn how to use helper functions in this video
Templating language is leveraged in helper functions available in personalization drop-down list of the Expression editor, as below:
In the Journey Optimizer Expression editor, helper functions are grouped into three categories: Functions, Helpers and Operators.
Select a category, to access sub-categories and functions.
Access to sub-categories by clicking the >
icon. Select a function by clicking on the +
icon: the function is automatically added to the personalization screen.
Click the ...
icon to view the description of the function and add it to your favorites. Learn more
Average | This function returns the arithmetic mean of all the selected values within the array |
Count | This function returns the number of elements within the given array |
Count Only Null | This function counts the number of null values in the list. |
Count With Null | This function counts all the elements of the list including null values |
Distinct | This function gets values from an array or a list with duplicate values removed |
Distinct Count With Null | This function counts the number of different values including the null values |
First item | This function returns the first item in an array or a list |
First n in array | This function returns the first `N` items in an array, when sorted in ascending order based on the given numerical expression |
In | This function is used to determine if an item is a member of an array or list |
Includes | This function determines if an array or list contains a given item |
Intersects | This function determines if two arrays or lists have at least one common member |
Last n in array | This function returns the last `N` items in an array, when sorted in ascending order based on the given numerical expression |
Maximum | This function returns the largest of all the selected values within an array |
Minimum | This function returns the smallest of all the selected values within the array |
Not in | This function determines if an item is not a member of an array or list |
Subset of | This function determines if a specific array (array A) is a subset of another array (array B), i.e. if all elements in array A are elements of array B |
Sum | This function returns the sum of all the selected values within the array |
Superset of | This function determines if a specific array (array A) is a superset of another array (array B), i.e. if that array A contains all elements in array B |
Age | This function retrieves the age from a given date |
Current time in milliseconds | This function retrieves current time in epoch millisecond |
Date difference | This function retrieves the difference between two dates in number of days |
Day of week | This function retrieves the day of week |
Day of year | This function retrieves the day of year |
Format date | This function formats a date time value |
Format date with locale support | This function formats a date time value into its corresponding language sensitive representation, i.e in a desired locale. |
Set Days | This function sets the day of the month for the given date-time |
Set Hours | This function sets the hour of the date-time |
To UTC | This function converts a datetime to UTC |
Week of year | This function returns the week of the year |
Get | This function is used to retrieve the value of a map for a given key |
Keys | This function is used to retrieve all the keys for a given map |
Values | This function retrieves all the values of a given map |
Absolute | This function formats any number into its language-sensitive representation. |
Format number | This function formats any number into its language-sensitive representation. |
Random | This function returns a random value between 0 and 1 |
Round down | This function rounds down a number |
Round up | This function rounds up a number |
To hex string | cconverts any number into its hexadecimal string. |
To percentage | This function converts a number to percentage |
To precision | This function converts a number to required precision |
To string | This function converts any number into its string representation. |
Is not null | This function is used to determine if an object reference exists |
Is null | This function is used to determine if an object reference does not exist |
Camel Case | This function is used to capitalize the first letter of each word of a string |
Char code at | This function returns ASCII value of a character, like the charCodeAt function in JavaScript |
Concat | This function is used to combine two strings into one |
Contains | This function is used to determine if a string contains a specified substring |
Does not contain | This function is used to determine if a string does not contain a specified substring |
Does not end with | This function is used to determine if a string does not end with a specified substring |
Does not start with | This function is used to determine if a string does not start with a specified substring |
Encode 64 | This function is used to encode or decode a string |
Ends with | This function is used to determine if a string ends with a specified substring |
Equals | This function is used to determine if a string does not start with a specified substring, with case sensitivity |
Equals Ignore Case | This function is used to determine if a string does not start with a specified substring, without case sensitivity |
Extract Email Domain | This function is used to extract the domain of an email address |
Format currency | This function converts any number into its corresponding language-sensitive currency representation depending on the locale passed as a string in the second argument |
Get url host | This function is used to get url host. |
Get url path | This function is used to get url path |
Get url protocol | This function is used to get url protocol |
Index Of | This function returns the position (in the first argument) of the first occurrence of the second parameter. Returns -1 if there is no match |
IsEmpty | This function is used to check if a string or expression is empty. |
Is Not Empty | This function returns true if the string in the parameter is not empty. |
Last Index Of | This function returns the position (in the first argument) of the last occurrence of the second parameter. Returns -1 if there is no match. |
Left trim | This function removes white spaces from beginning of a string |
Length | This function is used to get the number of characters in a string or an expression |
Like | This function is used to determine if a string matches a specified pattern |
Lower Case | This function converts a string to lower case letters |
Mask | This function is used to replace a part of a string with "X" characters. |
Matches | This function is used to determine if a string matches a specific regular expression |
MD5 | This function returns md5 hash of input string. |
Not equal to | This function is used to determine if a string is not equal to the specified string |
Not Equal With Ignore Case | This function compares two strings ignoring case. |
Regular expression group | This function is used to extract specific information, based on the regular expression provided |
Replace | This function replaces a given substring in a string with another substring |
Replace all | This function replaces all substrings of a text that matches the "target" with the specified literal "replacement" string |
Right trim | This function removes white spaces from end of a string |
Split | This function is used to split a string by a given character |
Starts with | This function is used to determine if a string starts with a specified substring |
String to date | This function converts a string value into a date-time value |
String to integer | This function Converts a string value into an integer value. |
String to number | This function is used to convert a string into number. It returns the same string as output for invalid input. |
Sub string | This function returns the sub-string of the string expression between the begin index and the end index. |
Title Case | This function is used to capitalize first letters of each word of a string |
To Bool | This function Converts an argument value into a boolean value, depending on its type. |
To Date Time | This function is used to convert string to date. It returns the epoch date as output for invalid input. |
To Date Time only | This function converts an argument value into a date time only value. It returns the epoch date as output for invalid input. |
Trim | This function removes white spaces from the beginning and from end of a string |
Upper case | This function converts a string to upper case letters |
Url decode | This function is used to decode a url encoded string. |
Url encode | This function is used to url encode a string. |
Helpers are detailed in this page.
Default fallback value | This function is used to render a variable with default |
Each | This function is used to iterate over an array |
If | This function is used to define a conditional block - if the expression evaluation returns true, the block is rendered |
Let | This function allows an expression to be stored as a variable to be used later in a query |
Unless | This function is used to define a conditional block - if the expression evaluation returns false, the block is rendered |
With | This function is used to change the evaluation token of template-part |
Arithmetic functions are used to perform basic calculations on values.
Addition | This operator is used to find the sum of two argument expressions |
Divide | This operator is used to find the quotient of two argument expressions |
Multiplication | This operator is used to find the product of two argument expressions |
Remainder | This operator is used to find the remainder after dividing the two argument expressions |
Subtraction | This operator finds the difference between two expressions |
Boolean functions are used to perform boolean logic on different elements.
And | This operator creates a logical conjunction |
Or | This operator creates a logical disjunction |
Comparison functions are used to compare between different expressions and values, returning true or false accordingly.
Equals | This operation checks if values are equal |
Greater than | This operator checks if first value is greater than the second value |
Greater or equals to | This operator checks if first value is greater than or equal to the second value |
Less than or equals to | This operator checks if first value is smaller than or equal to the second value |
Not equals to | This operator checks if given expression not equal to give value |
Learn how to transform personalization values using personalization helper functions and understand different use cases for helper functions.