Field Formulas
Write expressions that compute values dynamically from other field inputs.
Overview
The formula engine powers the Calculated Field as well as dynamic default values and conditional logic expressions. Formulas are written as JavaScript-like expression strings evaluated safely in a sandboxed context — they cannot access browser APIs, make network requests, or modify the DOM.
Syntax Reference
Reference field values using {field_name}. Standard operators:
| Property | Type | Default | Description |
|---|---|---|---|
| + | — | — | Addition (also string concatenation). |
| - | — | — | Subtraction. |
| * | — | — | Multiplication. |
| / | — | — | Division. |
| % | — | — | Modulo (remainder). |
| ( ) | — | — | Grouping to control operator precedence. |
| > < >= <= == != | — | — | Comparison operators returning true/false. |
| && || | — | — | Logical AND / OR. |
| ? : | — | — | Ternary conditional: condition ? valueIfTrue : valueIfFalse. |
Built-in Functions
| Property | Type | Default | Description |
|---|---|---|---|
| IF(cond, a, b) | — | — | Returns a if cond is truthy, otherwise b. |
| ROUND(n, d) | — | — | Rounds n to d decimal places. |
| FLOOR(n) | — | — | Rounds n down to the nearest integer. |
| CEIL(n) | — | — | Rounds n up to the nearest integer. |
| ABS(n) | — | — | Returns the absolute value of n. |
| MIN(a, b) | — | — | Returns the smaller of two values. |
| MAX(a, b) | — | — | Returns the larger of two values. |
| CONCAT(a, b, ...) | — | — | Joins strings together. |
| LENGTH(s) | — | — | Returns the character length of string s. |
| NOW() | — | — | Returns the current timestamp in milliseconds. |
Examples
// Sum of line items
{price_per_unit} * {quantity}
// Tax calculation with rounding
ROUND({subtotal} * 1.13, 2)
// Conditional discount
IF({quantity} >= 10, {unit_price} * 0.85, {unit_price})
// Full name from parts
CONCAT({first_name}, " ", {last_name})
// BMI calculation
ROUND({weight_kg} / ({height_m} * {height_m}), 1)