Get started with Helper functions

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.

➡️ Discover how to use helper functions (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 automaticaly added to the personalization screen.

Functions

Array Functions

 Average This function returns the arithmetic mean of all the selected values within the array In This function is used to determine if an item is a member of an array or list Minimum This function returns the smallest of all the selected values within the array Count This function returns the number of elements within the given array Includes This function determines if an array or list contains a given item Not in This function determines if an item is not a member of an array or list Distinct This function gets values from an array or a list with duplicate values removed Intersects This function determines if two arrays or lists have at least one common member 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 First item This function returns the first item in an array or a list 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 Sum This function returns the sum of all the selected values within the array 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 Maximum This function returns the largest of all the selected values within an 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

Date Time Functions

 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 Set days This function sets the day of the month for the given date-time Set days 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

Map Functions

 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

Object Functions

 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

String Functions

 Camel Case This function is used to capitalize the first letter of each word of a string 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 IsEmpty This function is used to check if a string or expression is empty. 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 Matches This function is used to determine if a string matches a specific regular expression Not equals to This function is used to determine if a string is not equal to the specified string 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 Title Case This function is used to capitalize first letters of each words of a string 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

Helpers

 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

Operators

Arithmetic functions

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

Boolean functions are used to perform boolean logic on different elements.

 And This operator creates a logical conjunction If This operator resolves an expression depending on whether a specified condition is true Not This operator creates a logical negation Or This operator creates a logical disjunction

Comparison functions

Comparison functions are used to compare between different expressions and values, returning true or false accordingly.

 Equals to 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 Not equals to This operator checks if given expression not equal to give value Less than or equals to This operator checks if first value is smaller than or equal to the second value

How-to video

Learn how to transform personalization values using personalization helper functions and understand different use cases for helper functions.