--- title: "Function Basics" slug: "basics-engage-functions" description: "Basics of Mapp Engage functions: libraries, expressions and placeholders, syntax, parameters, operators, and typical usage in rules." status: "update" updated: 2026-11-04T13:47:33Z published: 2026-11-04T13:47:33Z canonical: "docs.mapp.com/basics-engage-functions" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Function Basics 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 `InsertIf` condition - 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 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](/v1/docs/personalization-tags-for-placeholders) and [Personalization Rules Syntax](/v1/docs/syntax-of-personalization-rules). 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: ```plaintext <%${library:function_name(argument1, argument2, ...)}%> ``` - `library`: The function library, `fn`, `ecm`, or `ecx`. - `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](/v1/docs/syntax-of-personalization-rules). --- ## 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](/v1/docs/attribute-references). --- ## Typical Usage Patterns Functions are most commonly used in conditional logic. Example: ```plaintext <%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](/v1/docs/mapp-engage-functions).