Skip to main content

Formulas and calculated fields

Build read-only calculated answers from numeric fields and data source columns.

Video coming soon

Formulas and calculated fields

id: academy-formulas · ~2–4 min

Record this lesson video, then set src on <LessonVideo id="academy-formulas" />.
Form Builder v2
Text
List
Image
Sign

Audience: Admin

Formula fields compute a numeric answer from other inputs. They are read-only for field users—the value updates live as dependencies change and is stored like any other answer when the form is submitted.

Add a formula field

Drag Formula from the toolbox onto the canvas. In the formula editor, type an expression and insert references with @ mentions from the picker (Fields and data source columns).

Example subtotal:

@quantity * @unit_price

Example total with tax and discount:

(@subtotal * (1 + (@tax_percent / 100))) - (@subtotal * (@discount_percent / 100))

Reference syntax

ReferenceMeaning
@field_codeA numeric field on the form (Number, Range, Rating, another Formula)
@list_field.column_keyA numeric column from a selected List / Data Source row

Only numeric-compatible sources appear in the mention picker: number inputs, ranges, ratings, other formulas, and list columns typed as number, numeric, integer, or decimal.

List example:

@equipment.price * @qty

The builder stores stable ID-based references internally; you edit with friendly @ codes. Renaming a field code updates display references while IDs keep formulas intact.

Operators and functions

Operators: + - * / % ^, with parentheses for grouping.

Functions available from the toolbar include:

FunctionExample
sum()sum(@a, @b, @c)
avg()avg(@score_1, @score_2)
min() / max()min(@price_a, @price_b)
round()round(@subtotal)
abs()abs(@variance)

Constants pi and e are supported where useful.

Always put an operator between references—@qty * @unit_price, not @qty @unit_price.

Decimals and display format

  • Decimals — optional rounding of the stored numeric result (for example 212.35 from 12.3456). Leave unset to keep full precision.
  • Format — display only: Number, Currency (USD via locale formatting), or Percent (0.15 displays as 15%).

Formatting does not change the underlying stored number unless decimals rounding is set.

Avoid circular dependencies

A formula cannot depend on itself, directly or indirectly.

Invalid:

total = @subtotal + @tax
subtotal = @total - @tax

The builder flags circular formulas and stops evaluation until you break the cycle.

Runtime and submission behavior

As the user edits referenced fields, the formula re-evaluates and writes the computed number into the answer. On submit, the formula value is saved under its field code like any other response.

If calculation fails (missing value, non-numeric input, invalid syntax, unknown reference), the UI shows an error and the stored value is empty until inputs are valid.

Tips

  • Place source fields above the formula so users fill dependencies first.
  • Enable only the Data Source columns formulas need—fewer columns mean a cleaner @ picker.
  • Use round() or Decimals for money lines; use Currency format for readable PDFs and reports.
  • After changing list bindings, reopen formulas that referenced removed columns.