Action References
ArrowFunctionAction
ArrowFunctionAction
Purpose
Define a reusable arrow function at runtime and store it on the API context (this.<contextPropertyName>). Other MScript snippets can call it to avoid repeating logic.
When to use it
- You need to reuse the same computation across multiple actions in the workflow.
- You want to keep map/filter/reduce code readable by defining helpers upfront.
Key fields
| Field | Type | Description |
|---|---|---|
parameterNames | [String] | Names of the function parameters (used inside functionBody). |
functionBody | Text | JavaScript body of the arrow function (wrap in { ... }). |
Example
{
"id": "a310-tax-fn",
"name": "setTaxCalculator",
"contextPropertyName": "calcPriceWithVat",
"parameterNames": ["price"],
"functionBody": "{ const vat = 0.18; return price * (1 + vat); }"
}
Later actions can call this.calcPriceWithVat(100) inside their MScript expressions.
Was this page helpful?
Built with Documentation.AI
Last updated Jan 3, 2026