--- title: "UI Event Actions" slug: "ui-event-actions" description: "Configure UI Event Actions with Action Buttons to create items in other modules or redirect to custom URLs using placeholders, functions and secure tokens." tags: ["UI Event Actions", "Custom URL Redirects", "Action Button Settings"] status: "update" updated: 2026-10-30T09:27:29Z published: 2026-10-30T09:27:29Z canonical: "documentation.encodify.com/ui-event-actions" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.encodify.com/llms.txt > Use this file to discover all available pages before exploring further. # UI Event Actions Actions are triggered when the user clicks the related Action Button on the UI. There are different UI Event Actions available: - Create New Item in Another Module (Generic); - Create New in Another Module (Ordering); - Redirect to Custom URL. There are UI event-specific settings available, like: - **Label for Action Button** — a text to be displayed on the button; > [!NOTE] > **Note:** **“Action button position”** is no longer respected, and location is now defined by the available space in the toolbars. ### Create New Item in Another Module (Generic) --- The Action allows you to add a button which will open the New Item window for the specified module. This is handy to use in pairs with an action which creates combinations based on the values of the source main item. The only specific parameter for this action is **Target Module**. ### Create New in Another Module (Ordering) --- This action allows the creation of items in another module, like the previous one, but uses additional specific logic and mappings to enable the Ordering functionality. ### Redirect to Custom URL --- The Action can associate the button with a pre-defined URL. The user who clicks the Action button will be navigated to the specified URL. The typical usage can be, for example, connecting to a third-party system using the current item's data for generating the access token and providing it in a GET request as a parameter for authentication. In the action settings, you can specify the URL using the **Placeholders** and **Functions** for fetching the data from the current item. #### Placeholders Use standard placeholders to insert the general data. - `${UserName}` inserts the name of the current user. - `${UserEmail}` inserts the email address of the current user. - `${SiteUrl}` inserts the URL of the current site specified in Site Settings, e.g. https://qatest.com. - `${LoginUrl}` inserts the Login Page URL, e.g. https://qatest.com/qa/common/login/ebms. - `${SiteId}` inserts the ID of the current site. - `${ModuleId}` inserts the ID of the current module. - `${ActionId}` inserts the ID of the action. - `${CurrentItem}` inserts Name Field value of the current item. > [!NOTE] > **Example** > > You can pass the user's Name and Email as parameters: > > ```plaintext > https://localhost/loginPage?user=${UserName}&email=${UserEmail} > ``` #### Functions and Variables Use functions to fetch and format the data. | Syntax | Explanation | Returns | | --- | --- | --- | | ```plaintext #set($variableName = 'sometext') ``` | Define a variable that can be reused in the formulas. The variable can contain static text or result of the function | - | | ```plaintext $CurrentItem ``` | System variable which returns the current item object. It is possible to apply methods to this variable in order to get the specific data from the fields | - | | ```plaintext $CurrentItem.fieldValue('field name') ``` | Get a single value from the item field | String | | ```plaintext $CurrentItem.fieldValue('module link').fieldValue('subfield') ``` | Get a value from the module link sub-field | String | | ```plaintext $CurrentItem.fieldValues('multiselect field name') ``` | Get multiple values from the multiselect item field | Array of Strings | | ```plaintext $tools.join(, 'delimiter', true/false) ``` | Format multiple values with a delimiter, e.g. as a comma-separated list. Set to **true** to skip the empty values. To use the previous formula | String | | ```plaintext $tools.base64Encode('some string') ``` | Encode the string to Base64 format | String | | ```plaintext $date.get('yyyy-M-d H:m:s') ``` | Inserts the action execution date by the specified mask, e.g. 2018-3-19 21:54:51. More about [Formatting dates](https://velocity.apache.org/tools/2.0/apidocs/org/apache/velocity/tools/generic/DateTool.html) | String | | ```plaintext $tools.aesGenerateKey('password', 'salt', , , 'algorithm') ``` | Generate a key using the AES key generator. The key can be used for encrypting/decrypting the data that is passed as an access token, and must be secure | String | | ```plaintext $tools.aesEncrypt('value', 'key','init vector', 'cipher name') ``` | Encrypt value using the key and init vector. Cypher name is optional | String | | ```plaintext $tools.aesDecrypt('enctypted value', 'key', 'init vector', 'cipher name') ``` | Decrypt value using the key and init vector. Cypher name is optional | String | | ```plaintext $number.toNumber('#,###,###', $mnum)) ``` | Change output format of the Number (`$mnum)` [Number Patterns](https://docs.oracle.com/javase/tutorial/i18n/format/decimalFormat.html) | - | | ```plaintext $date.format('MM/dd/yyyy', $mdate ) ``` | Change output format of the Date (`$mdate)` [Date Patterns](https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html) | - | For more formulas, see [Apache Velocity Engine](http://velocity.apache.org/engine/1.7/user-guide.html) documentation. > [!WARNING] > Single quote in field names must be escaped by an extra single quote: > > ```plaintext > $CurrentItem.fieldValue('Name with ''single  quote'' inside') > ``` > > See more about [How to escape the special characters](https://velocity.apache.org/tools/2.0/apidocs/org/apache/velocity/tools/generic/EscapeTool.html). #### Examples Creating a UI Action which generates the secure access token and forms the redirect URL link to a third-party system. - Create the unique value for an access token by combining the module link sub-field value (e.g., the number of the linked campaign) and the current date ```plaintext #set($valueForToken = $CurrentItem.fieldValue('Campaign').fieldValue('Number') + '_' + $date.get('yyyy-MM-dd')) ``` - Generate an AES key for encryption ```plaintext #set($aesKey = $tools.aesGenerateKey('some_Password', '736f6d655f53616c54', 1024, 256, 'PBKDF2WithHmacSHA1')) ``` - Specify the init vector variable ```plaintext #set($initVector = 'fdbfdca92e0cd82e042a733626853d3f') ``` - Encrypt the token using AES key and init vector ```plaintext #set($encryptedToken = $tools.aesEncrypt($valueForToken, $aesKey, $initVector)) ``` - Generate a final link for a redirect, providing a token, user name and email ```plaintext https://test.com/api/check/?token=$encryptedToken&name=${UserName}&email=${UserEmail} ``` - Change output format of a Date from dd/mm/yyyy to mm/dd/yyyy ```plaintext #set($mdate = $date.toDate('dd/MM/yyyy', '17/10/1991')) $date.format('MM/dd/yyyy', $mdate ) // output 10/17/1991 ``` - Change output format of a value from a Date-Time field ```plaintext {   "fieldDefinitionId": 4342,   "name": "DateTime",   "options": [     {        "id": 0,        "value": "$date.format('MM/dd/yyyy HH:mm', $date.toDate('dd/MM/yyyy HH:mm', $CurrentItem.fieldValue('DateTime')))"     }   ] } ``` - Change the output format of a Number from 14,999,999.0 to 14999999 ```plaintext #set($mnum = $number.toNumber('#,###,###.###','14,999,999.0')) $mnum //14999999 ``` - Change the output format of a value from the Number field ```plaintext {    "fieldDefinitionId": 4336,    "name": "Int",    "options": [       {         "id": 0,         "value": "$number.toNumber('#,###,###', $CurrentItem.fieldValue('Int'))"       }   ] } ``` - Convert number to specified format (US or International) ```plaintext //convert number from International format to text field (result in International format): $number.toNumber('###,###.00', $CurrentItem.fieldValue('Dec'), $danishLocale) //convert number from International format to US format: $number.format('###,###.00', $number.toNumber('###,###.00', $CurrentItem.fieldValue('Dec'), $danishLocale), $usLocale) //convert number from US format to International format: $number.format('###,###.00', $number.toNumber('###,###.00', $CurrentItem.fieldValue('DEC US'), $usLocale), $danishLocale) ``` - Format a decimal number that contains more than 7 digits ```plaintext //If $CurrentItem.fieldValue('Dec') in International format = 22.999.778,05: $number.format('#0.00', $number.toNumber('#,###,###.##', $CurrentItem.fieldValue('Dec'), $danishLocale)) //output: 22999778,05 //If $CurrentItem.fieldValue('Dec') in US format = 22,999,778.05: $number.format('#0.00', $number.toNumber('#,###,###.##', $CurrentItem.fieldValue('Dec'), $usLocale)) //output: 22999778.05 ``` - To ignore Date/Number Fields by HTTP Action if empty: ```plaintext #set($value = $CurrentItem.fieldValue('Week')) #if( $value != "" ) #set($resultValue = $date.format('yyyy-ww', $date.toDate('ww-yyyy', $value))) #else #set($resultValue = "") #end { "active": true, "expired": false, "fields": [ { "fieldDefinitionId": 4343, "name": "Week", "options": [ { "id": 0,                                        "value": "$resultValue" } ] } ], "id": 0, "links": [ { "href": "string", "rel": "string", "templated": true } ] } ```