Docs / Forms & Automation

Expressions & computed fields

Calculate a value from other fields using a formula.

An Expression is a formula written in terms of other fields' names, wrapped in curly braces — {fieldName} — that Craftor evaluates live in the browser as the visitor fills in the form. Two things use them: the dedicated Computed/Expression field type (shows the result as its own field) and the Range Slider's optional Min/Max Value Expression settings (drives a slider's bounds off another field instead of a fixed number).

Adding a computed field

  1. 1Add a field and set its type to Computed / Expression.
  2. 2In the Expression setting, write a formula referencing other fields by name, e.g. {quantity} * {price}.
  3. 3Set Display As to control formatting: Plain Number, Decimal, Currency (pick the currency), Percent, or Date.
text
{quantity} * {price}
({subtotal} - {discount}) * 1.1   // apply 10% tax after a discount
{hours_worked} > 40 ? {hours_worked} - 40 : 0   // overtime hours
iif({country} = 'US', {price}, {price} * 1.2)   // conditional formula

A Computed field recalculates every time one of its referenced fields changes, and re-runs again on submit — it's always live, never a one-time snapshot taken when the field was first shown.

Formula reference

  • Reference a field: {fieldName} — the same auto-generated name used everywhere else (conditional logic, merge tags, workflow steps).
  • Arithmetic: + - * / and parentheses for grouping, following normal order of operations.
  • Comparisons: = != > >= < <=, and and / or to combine them.
  • Conditional: condition ? valueIfTrue : valueIfFalse, or the equivalent iif(condition, valueIfTrue, valueIfFalse).
  • String matching: contains / notcontains, e.g. {email} contains '@company.com'.

Driving a slider's range from another field

On a Range Slider field, Min Value Expression and Max Value Expression (under its slider settings) take the same formula syntax and override the plain Min Value/Max Value settings whenever they're non-empty — e.g. set Max Value Expression to {budget} so a "how much to allocate to this category" slider can never exceed what the visitor entered as their total budget earlier in the form.

Expressions can only reference fields that appear earlier in the form (or elsewhere on an already-answered page) — a formula can't reference a field further down that hasn't been answered yet, since there's nothing to read.