Frontend Scripting with JEXL
JEXL (JavaScript Expression Language) enables dynamic behavior in tSM forms — such as showing/hiding fields, calculating default values, or enforcing validation rules — all without backend code.
It runs in the browser at runtime, and is used throughout forms and pages via the Form Designer.
What is JEXL Used For?
| Use Case | Example |
|---|---|
| Conditional visibility | Hide a field if the user selects "B2C" |
| Default values | Set date field to "today + 1" |
| Custom validation | Ensure value falls within limits based on another field |
| Data transformation | Join two strings or check if an item exists in a list |
| Context-based filtering | Show only orders for the current customer |
Where JEXL Can Be Used
You’ll see JEXL-enabled fields in the Form Designer with a toggle icon:
hidden,readonly,disableddefaultvaluevalidationMessagesconfigfields- Listing filters
Once toggled, you can insert single-line expressions in JEXL.