Helper functions library

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.

Functions

Array Functions

AverageThis function returns the arithmetic mean of all the selected values within the array
InThis function is used to determine if an item is a member of an array or list
MinimumThis function returns the smallest of all the selected values within the array
CountThis function returns the number of elements within the given array
IncludesThis function determines if an array or list contains a given item
Not inThis function determines if an item is not a member of an array or list
DistinctThis function gets values from an array or a list with duplicate values removed
IntersectsThis function determines if two arrays or lists have at least one common member
Subset ofThis 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 itemThis function returns the first item in an array or a list
Last n in arrayThis function returns the last `N` items in an array, when sorted in ascending order based on the given numerical expression
SumThis function returns the sum of all the selected values within the array
First n in arrayThis function returns the first `N` items in an array, when sorted in ascending order based on the given numerical expression
MaximumThis function returns the largest of all the selected values within an array
Superset ofThis 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

Map Functions

GetThis function is used to retrieve the value of a map for a given key
KeysThis function is used to retrieve all the keys for a given map
ValuesThis function retrieves all the values of a given map

Object Functions

Is not nullThis function is used to determine if an object reference exists
Is nullThis function is used to determine if an object reference does not exist

String Functions

Camel CaseThis function is used to capitalize the first letter of each word of a string
ConcatThis function is used to combine two strings into one
ContainsThis function is used to determine if a string contains a specified substring
Does not containThis function is used to determine if a string does not contain a specified substring
Does not end withThis function is used to determine if a string does not end with a specified substring
Does not start withThis function is used to determine if a string does not start with a specified substring
Encode 64This function is used to encode or decode a string
Ends withThis function is used to determine if a string ends with a specified substring
EqualsThis function is used to determine if a string does not start with a specified substring, with case sensitivity
Equals Ignore CaseThis function is used to determine if a string does not start with a specified substring, without case sensitivity
Extract Email DomainThis function is used to extract the domain of an email address
IsEmptyThis function is used to check if a string or expression is empty.
Left trimThis function removes white spaces from beginning of a string
LengthThis function is used to get the number of characters in a string or an expression
LikeThis function is used to determine if a string matches a specified pattern
Lower CaseThis function converts a string to lower case letters
MatchesThis function is used to determine if a string matches a specific regular expression
Not equals toThis function is used to determine if a string is not equal to the specified string
Regular expression groupThis function is used to extract specific information, based on the regular expression provided
ReplaceThis function replaces a given substring in a string with another substring
Replace allThis function replaces all substrings of a text that matches the "target" with the specified literal "replacement" string
Right trimThis function removes white spaces from end of a string
SplitThis function is used to split a string by a given character
Starts withThis function is used to determine if a string starts with a specified substring
Title CaseThis function is used to capitalize first letters of each words of a string
TrimThis function removes white spaces from the beginning and from end of a string
Upper caseThis function converts a string to upper case letters

Helpers

Helpers are detailed in this page.

EachThis function is used to iterate over an array
IfThis function is used to define a conditional block - if the expression evaluation returns true, the block is rendered
LetThis function allows an expression to be stored as a variable to be used later in a query
UnlessThis function is used to define a conditional block - if the expression evaluation returns false, the block is rendered
WithThis function is used to change the evaluation token of template-part

Operators

Arithmetic functions

Arithmetic functions are used to perform basic calculations on values.

AdditionThis operator is used to find the sum of two argument expressions
DivideThis operator is used to find the quotient of two argument expressions
MultiplicationThis 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.

AndThis operator creates a logical conjunction
IfThis operator resolves an expression depending on whether a specified condition is true
NotThis operator creates a logical negation
OrThis operator creates a logical disjunction

Comparison functions

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

Equals toThis operation checks if values are equal
Greater thanThis operator checks if first value is greater than the second value
Greater or equals toThis operator checks if first value is greater than or equal to the second value
Not equals toThis 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.

On this page