Functions process, compare, and transform data at runtime. You use them inside expressions, mainly to control logic in personalization, selections, and automated processes.
This page explains the concepts that all function pages assume.
Purpose of Functions
Functions evaluate data dynamically and determine behavior based on conditions. Typical use cases:
Controlling content visibility in personalization rules, for example in an
InsertIfconditionComparing values from attributes or related data
Formatting or modifying values before inserting them into messages
Evaluating conditions for selections or automation logic
Functions always return a value. Depending on the function, this can be a Boolean, string, number, or date. The returned value is then evaluated inside the expression.
Function Libraries
Mapp Engage supports standard JSTL functions and its own function libraries. The library prefix is part of the function name and indicates its scope.
fn: General-purpose JSTL functions for strings, numbers, dates, and Boolean checks.ecm: Extended functions for advanced comparisons, calculations, and pattern matching.ecx: Engage-specific functions for platform-related logic, such as working with coupons or advanced data access.
Expressions and Placeholders
Functions are evaluated inside expressions. An expression is code that the system processes at runtime. Two elements are used:
${ }contains the expression with functions, operators, and values.<% %>encloses the expression and marks where the result is inserted into the message.
Together, they form a placeholder, for example <%${fn:toUpperCase(user['FirstName'])}%>. In a personalization rule, the expression is in the expression attribute of the InsertIf tag, and the result controls whether content is inserted. See Personalization Placeholders and Personalization Rules Syntax.
An expression can contain a single function or several nested functions.
Function Structure and Syntax
A function consists of the library prefix, the function name, and arguments:
<%${library:function_name(argument1, argument2, ...)}%>library: The function library,fn,ecm, orecx.function_name: The function to execute.argument1, argument2, ...: The values the function operates on.
Functions can be nested. The result of one function is then the input of another.
Parameters and Values
Function arguments can be static or dynamic:
Static values are written directly in the expression. Strings are enclosed in single quotes. Numbers are written without quotes.
Dynamic values reference data that is evaluated at runtime, such as profile data or related data.
Functions do not change the data stored in the system. All processing happens at runtime.
Operators and Evaluation Logic
Operators evaluate the values that functions return. Typical uses:
Check equality or inequality
Compare numeric or date values
Evaluate string-based conditions
The operator determines whether the expression is true or false, or how the value is processed further. For all operators, see Personalization Rules Syntax.
Data Context
Functions can work with different data sources:
Profile attributes
Linked related data
Unlinked related data
The data source affects how you reference the data in a function. The individual function pages describe the details. For the notation of attributes, see Attribute References.
Typical Usage Patterns
Functions are most commonly used in conditional logic. Example:
<%InsertIf expression="${fn:toUpperCase(user.CustomAttribute['job title'])=='MANAGER'}"%>
Text
<%/InsertIf%>The function converts the value to uppercase, the operator compares the result with MANAGER, and the outcome controls whether the content is inserted.
Scope and Limitations
Functions evaluate data and control logic at runtime. They do not replace scripting or complex business logic. Keep expressions as simple as possible so that they stay readable and maintainable.
Next Steps
For an overview of all function categories with examples, see Functions.