You can use JavaScript expressions to perform a variety of data manipulation functions, including string manipulation, mathematical calculations, and array processing. JavaScript expressions can be used in business objects, events (in event field constructors), and actions.
The end result is a value that is evaluated by the event runtime during event rule evaluation (for events and business objects) or passed to a touchpoint system (for actions).
You can declare variables and assign values to those variables. All variables are considered local to the business object, event, or action where they are defined.
To find out more information on how to create JavaScript expressions in business objects, events, and actions, see JavaScript expressions in business objects, event objects, and action objects.
Although the full range of JavaScript syntax is supported, only use data manipulation activities in Event Designer. Do not, for example, include JavaScript commands used to display data.
Because no formal syntax checking is performed, when JavaScript is added to an event project you must ensure that JavaScript syntax is correctly constructed. Syntax errors are flagged at run time when the event runtime attempts to resolve the JavaScript expression. See, Testing JavaScript in Event Designer.