formbasedocs
Go to appApp

Building Forms

Calculated fields

Invisible fields that compute values from answers — quiz scores, order totals, lead ratings, or concatenated text. They update in real time as the respondent fills out the form.


How it works

Calculated fields are invisible to respondents but compute values based on logic rules you define. They store either a number or text result, and update live as the respondent answers questions.

The flow: you create a calculated field, set an initial value, then add logic rules with the Calculate value action. Each rule runs an operation (add, multiply, set, etc.) when its condition is met.

Adding a calculated field

Type / on an empty line and pick Calculated Field from the Layout category. It only works at the top level of the form — not inside a column or a repeating group. Set:

  • Field type — number or text

  • Name — how you refer to it in logic rules and @ mentions. It is also this field’s key, so the value goes out to integrations and callbacks under it

  • Initial value — the starting value before any rules fire. Either type a literal (e.g. 0 for a score) or pick a hidden field of the same type to seed it from a URL parameter. If the parameter is missing or invalid, the field starts at 0 (number) or empty (text)

Numeric operations

These are the exact entries in the operation picker on a Calculate value action.

OperationWhat it does
addAdd a value to the current total.
subtractSubtract a value from the current total.
multiplyMultiply the current total by a value.
divideDivide the current total by a value. Dividing by 0 is skipped.
set toReplace the current total with a new value.
reset to initialRestore the field's initial value.

Text operations

OperationWhat it does
set toReplace the current text with a new value.
append textAdd text to the end of the current value.
prepend textInsert text before the current value.
reset to initialRestore the field's initial value.

Operation values

Each operation takes a value that is either:

  • A fixed value — a specific number or string you type in (e.g. always add 10)

  • The value of another field — pick a question, hidden field, or calculated field so the value is dynamic (e.g. add whatever the respondent entered in Q2)

A numeric operation is skipped when its value is empty or isn’t a number, and dividing by 0 is skipped too, so the current total stays as it is. Answers to questions hidden by logic don’t count — a hidden question has no value at all, so its answer never reaches a calculation.

Every matching Calculate value rule runs, in document order, on the running value — they stack rather than compete. One exception to document order: a rule that reads a calculated field always runs after the rule that writes it, so a score is finished before anything branches on it. Rules that write each other’s fields in a loop are flagged as a publish warning that names the chain, so break the loop rather than publish through it.

Examples

Quiz scoring — Create a calculated field “Total score” with initial value 0. Add logic rules: if Q1 equals “Yes”, Add 10; if Q2 is greater than 5, Add the value of Q2. The score updates live as the respondent answers.

Dynamic pricing — A product order form has a Number field for quantity and a Dropdown for size (Small, Medium, Large). Create a “Price” calculated field. Logic rules: if size is “Small”, Set to 10; if “Medium”, Set to 15; if “Large”, Set to 20. Below those, add a rule with no conditions that Multiplies Price by the quantity field. Rules run top to bottom, and a rule with no conditions always runs. Pipe @Price into the thank-you page. To charge that calculated price directly, see Dynamic pricing in Payment collection.

Lead qualification — Three Star Rating questions rate budget, timeline, and authority. A “Lead score” field uses Add for each rating. A logic rule checks: if Lead score is greater than 12, Set next page “Priority follow-up”; otherwise jump to the standard thank-you.

Concatenating text — A text calculated field “Full name” starts empty. Logic appends @First name, then appends a space, then appends @Last name. Use @Full name in the thank-you page or email notifications.

Chain with logic

Calculated fields also work as condition sources. One rule computes a value, another reacts to it — e.g. “if Total > 50, jump to the Premium page.” This lets you build multi-step scoring without any code.

Pre-populating other fields

A visible field can start with a calculated field’s value, so the respondent reviews a computed value instead of typing it. In a Text Input, Text Area, Email, Phone Number, Website URL, or Number field, type @ at the start of the input and pick the calculated field. The respondent can still change the value.

The input takes the first value the calculated field has — usually its initial value, or the hidden field that seeds it. Later changes from logic rules don’t replace what is already in the input. To show a value that keeps updating, pipe it into text with an @ mention instead. See Default values from other fields for details.

Next steps