Basics

Prev Next

Functions are commands used in Mapp Engage to process, compare, and transform data at runtime. They are evaluated inside expressions and are primarily used to control logic in personalization, selections, and automated processes.

This page explains the fundamental concepts required to work with functions. It provides the shared foundation that is assumed on all individual function pages.


Purpose of functions

Functions are used to dynamically evaluate data and determine behavior based on conditions. Typical use cases include:

  • Controlling content visibility in personalization rules (for example, InsertIf)

  • Comparing 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 an expression.


Function libraries

Mapp Engage supports standard JSTL functions as well as custom function libraries.

  • 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.

The library prefix is part of the function name and indicates its functional scope.


Expressions and placeholders

Functions are evaluated inside expressions. An expression defines a block of code that is processed by the system at runtime.

Two elements are used:

  • Placeholder

    <% %> marks where the evaluated result is inserted into a message.

  • Code block

    ${ } defines the expression that contains functions, operators, and values.

Expressions can contain a single function or multiple nested functions.


Function structure and syntax

Functions follow a defined syntax and consist of a function name and parameters.

General structure:

<%${library:function_name(argument1, argument2, ...)}%>
  • library defines which function library is used (fn, ecm, ecx)

  • function_name specifies the function to execute

  • arguments define the values the function operates on

Functions can be nested, allowing the result of one function to be used as the input for another.


Parameters and values

Function parameters can be static or dynamic.

  • Static values are defined 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.

The actual data stored in the system is not modified by functions. All processing is performed at runtime only.


Operators and evaluation logic

Operators are used to evaluate the values returned by functions. They define how results are compared or interpreted inside expressions.

Operators are typically used to:

  • Check equality or inequality

  • Compare numeric or date values

  • Evaluate string-based conditions

Operators are applied to function results and determine whether an expression evaluates to true or false, or how values are processed further.


Data context (conceptual)

Functions operate on different types of data sources within Mapp Engage. Depending on the use case, functions can work with:

  • Profile attributes

  • Linked related data

  • Unlinked related data

These data contexts influence how functions are applied and combined. The technical details of accessing specific data sources are described on the individual function pages.


Typical usage patterns

Functions are most commonly used in conditional logic.

Example:

<%InsertIf expression="${fn:toUpperCase(user.CustomAttribute['job title'])=='MANAGER'}"%>
Text
<%/InsertIf%>

In this pattern, a function processes a value, the result is evaluated with an operator, and the outcome controls whether content is inserted.


Scope and limitations

Functions are designed to evaluate data and control logic at runtime. They are not intended to replace scripting or complex business logic. For readability and maintainability, expressions should remain as simple as possible.


Next steps

After understanding the basics, continue with the documentation for individual function categories. These pages describe available functions in detail and provide concrete examples for specific use cases.