---
title: "Calculations & Default Values"
description: "How to prefill fields with default values, show earlier answers in text blocks, and calculate values with formulas."
slug: "calculations-and-default-values"
audience: "all"
generated_at: "2026-11-17T20:42:45.885Z"
screenshots:
  - "/docs/screenshots/calculations-and-default-values/form-step.png"
---

Default values prefill a field before the respondent answers, and calculated fields compute a value from a formula. Both are set in the field settings panel in the FormAssembly workflow builder, on a field in a **Collect** step.

To open field settings, select the field on the canvas in Focus view and click the pencil on the field toolbar. The panel opens with **Label**, **Hint**, **Placeholder**, **Value**, **Default value** and **Scale** at the top, with the remaining settings in collapsible groups.

![A Collect step open in the FormAssembly workflow builder](/docs/screenshots/calculations-and-default-values/form-step.png)

To show or hide a field based on an answer, see Conditions & Validation.

## How do I set a default value on a field?

A default value is the answer the respondent sees when the form opens, which they can then change.

1. Select the field on the canvas in Focus view.
2. Click the pencil on the field toolbar to open field settings.
3. Enter the value in **Default value**.

Text, long text, number, time and rating fields take a value you type. A date field offers None, Current date or Custom. Current date uses the workflow's time zone, or the account's time zone when the workflow sets none.

A default value can include a Field Reference, so a field can be prefilled from an earlier step or from a URL parameter declared on the step. Click **Insert field value** beside **Default value** to add one. The picker also offers the step's own variables; when the step declares none and there is nothing to offer, the panel shows a pointer to step settings instead. A reference that cannot be resolved shows blank.

File upload, Date & time and ranked-choice fields cannot have a default.

You can also ask Fai, FormAssembly's AI assistant, to set a default value or write a formula for you.

### Default values on choice fields

Dropdown, radio, checkbox and multi-select fields have a **Default value** row with four modes:

- **None** preselects nothing.
- **Chosen options** preselects options you pick: one option on a dropdown or radio field, several on a checkbox or multi-select field.
- **From a value** takes one value, or a Field Reference, and selects the option whose label or id it names.
- **Per option** gives each option its own input, so you set each one separately.

Ranked choices has no default value.

## How do I show a value from an earlier step in a text block?

A text block on a form can show a value from an earlier step: a field's answer or a declared variable. Write it as a Field Reference, for example `{{ step_1.firstName }}`. The respondent sees the value instead of the reference when the form opens.

Typical uses are to greet the respondent by a name collected on an earlier step or passed in the link, to show a reference number a connected system returned, or to show an approver's comment when a response comes back for correction.

Type the Field Reference into the text block yourself, or ask Fai to add it. Text blocks have no **Insert field value** picker.

The builder shows the Field Reference as typed, not the value. Test mode shows the value.

The value is filled in once, when the form opens. A text block cannot echo an answer from the same form as the respondent types.

A value containing HTML shows as plain text, never as formatting. A Field Reference that resolves to nothing shows as blank, and FormAssembly refuses to publish a workflow when a Field Reference names a field or variable that does not exist.

## How do I make a field calculated?

A calculated field computes its own value from a formula instead of taking an answer from the respondent.

1. Select the field on the canvas in Focus view and open field settings.
2. In the **Value** row, choose **Calculated**.
3. Click the **fx** button beside the formula box to open the formula editor.
4. Write the formula, then click **Apply formula**.

A calculated field has no default value: the **Default value** row is hidden while **Calculated** is selected, and applying a formula clears any default the field had.

Switching a calculated field back to **Respondent input** clears its formula after a confirmation dialog. With no formula to clear, FormAssembly makes the switch without asking.

The formula box in field settings shows the saved formula with each field named by its label. It is display only: rename a field it reads and the box shows the new label, while the stored formula is unchanged.

## Where can a calculated result go?

A calculated result can go in a text, long text, number, date or time field, and it must suit that field's data type. A number field takes a number, a date field a date, a time field a time, and a text field anything.

Rating fields can be read by a formula but cannot hold a calculated result.

## What can a formula read?

A formula reads answers from fields on the same form, and from fields on earlier Collect steps.

A formula names a field by its calculation name or by its id, for example `tfa_3`. If a calculation name is spelled the same as another field's id, the calculation name wins.

A field's type comes from how it is set up, not from what the respondent typed: a text field holding `42` is text, not a number. A choice field reads as the chosen option's label, as text; a formula can still compare that label, for example inside IF.

A formula cannot read checkbox, multi-select or ranked-choices answers, date & time fields or file uploads. Those fields hold several values at once, or a value the formula language has no case for, so FormAssembly refuses to publish a formula that reads one.

A field cannot feed its own calculation, so the formula editor never offers the field you are editing, and a calculation that depends on itself blocks publishing. Field order does not matter: FormAssembly runs calculations in dependency order, so a total placed above the fields it adds up still computes.

### Reading a field from an earlier step

A formula can name a field on an earlier Collect step as `step_N.` followed by the field's id, for example `step_1.tfa_3`. Pick the field from the **Form fields** category in the palette and the formula editor writes the reference for you.

That value is fixed when the page loads, while a field on the current form stays live and recalculates as the respondent types.

Only Collect-step fields can be named this way, never a variable or an option. A step counts as earlier when some path through the workflow reaches this step after it; a step reached only through a loop reads blank until the loop has run. An assignment's workflow and the workflow around it cannot read each other's steps. A formula that reads a repeated earlier-step field of any type other than number blocks publishing.

## Using the formula editor

The formula editor opens from the **fx** button beside the formula box. Its header reads "Building formula for" followed by the field's label, or "this field" when the label is empty.

The formula box spans the top of the editor. Type directly in it, or insert items from the palette, which inserts at the caret rather than at the end. A field you pick shows as a chip carrying the field's label, while the formula stores the field's reference underneath.

While you type inside a function, a hint below the box names the argument you are on and links to that function's entry in the function reference. While you type a function name, FormAssembly suggests the functions that start with it; press Enter or Tab to accept the active suggestion. Accepting replaces what you typed with the full name and an opening bracket, so `rou` becomes `ROUND(`. Press Escape to close the suggestion list, and Undo to reverse a completion.

Problems with the formula are marked in the editor as you type, with a message beneath the box for each one. A problem does not block **Apply formula**, so you can keep a draft and come back to it. Two things do block it: an empty formula, and a field chip inside quotation marks.

Click **Apply formula** to save the formula, or **Cancel** to close without changing the field.

### The formula palette

Below the formula box is a list of categories. On a wide screen the categories sit beside their items; on a narrow screen they are a row above them.

- **Form fields** lists this form's fields and fields from earlier Collect steps, with each field's type ("Text field", "Email field", "Date field") and, for an earlier step, that step's name.
- **Math & numbers** holds the operators (add, subtract, multiply, divide, power and brackets) and the Math functions.
- Each other function category, for example **Logic** or **Date and time**, has its own entry listing its functions with a one-line description.

The search box narrows the open category only, and its name follows that category: "Search fields" on **Form fields**, "Search functions and operators" on **Math & numbers**, and "Search functions" elsewhere.

A formula can use functions as well as operators, and the categories below the formula box list every function with its description. For the full list of functions and what each one returns, see Formula Functions.

### Writing operators, numbers and text

A formula uses `+`, `-`, `*`, `/` and `^` for arithmetic, `&` to join two values as text, and the comparison operators. Put text in single or double quotation marks.

Function names ignore case, so `round` and `ROUND` are the same function. Write a decimal with a leading zero, `0.5` rather than `.5`. A chained comparison such as `1 < x < 5` is refused, so compare one pair at a time.

The date and time functions read the date or time when the form opens, and again when an answer a calculation uses changes; the value stored on the response is the one at submission. `LOCALTODAY()` and `LOCALNOW()` follow the workflow's time zone, while `TODAY()` and `NOW()` are UTC; none of them follows the respondent's own time zone. Date functions can move a date by a number of days or months, or count the days or years between two dates. A date can be compared with another date and a time with another time, but neither takes `+` or `-`: use the date functions instead.

## How do calculated results appear to respondents?

A calculated field recomputes in the respondent's browser as soon as an answer it reads changes, and FormAssembly recomputes it again on the server when the response is submitted, so the stored value is always the server's.

Results are exact and are not rounded unless the formula uses ROUND. A result is shown with the workflow language's decimal separator and thousands grouping, for example `1,234.56` in English and `1.234,56` in German. Form Language covers number formats.

Calculations are not evaluated in the builder preview, so a calculated field shows no result on the canvas. Run **Test** to see results.

A calculated field shows "error" (a date or time field shows empty instead), with the message "This value can't be calculated.", when the formula divides by zero, when a number it reads is not a plain decimal (for example `1e3`), or when the result is too large or too precise to compute exactly. When the field is hidden from respondents, a banner at the top of the form shows the error instead, since a hidden field has nowhere inline to show a message.

A field a formula reads that nobody answered counts as blank, and blank carries through arithmetic: a total over an unanswered quantity is blank, not zero.

## Calculations in repeatable sections

A calculated field inside a repeating section reads that section's fields from its own entry only, so a line total beside each row totals that row. Fields outside the section are still read in full.

A calculated field outside the section combines values across all entries of the section it reads, so an order total outside the section sums every row. Numbers are summed and text is joined in row order; blank rows are skipped.

A date, time or yes/no field answered in more than one entry has no single value, so a formula outside the section that reads one shows "error".

## Tips & Troubleshooting

- **The field shows "error" on the live form.** The formula could not be computed with the values supplied: check for a division by zero, a number field whose answer is not a plain decimal, or a date or time field read from several repeat entries at once. Guard a divisor with an IF test, or use BLANKVALUE to supply a fallback.
- **The calculated field shows nothing in the builder.** Calculations are not evaluated in the builder preview. Click **Test** to run the workflow and see the computed value.
- **Publish is refused because of a formula.** FormAssembly refuses a formula that reads a checkbox, multi-select, ranked-choices, date & time or file upload field, one whose result does not suit the field's data type, one that depends on itself, and one that reads a repeated earlier-step field that is not a number. Open the field's settings to read the listed problems, each of which names the rule it broke.
- **A Field Reference shows as literal text on the form.** Write references as `{{ step_1.fieldId }}`, with the step id, a dot and the field id inside double braces.
- **A total is blank instead of a number.** One of the fields the formula reads was left unanswered or is hidden, and blank carries through arithmetic. Supply a substitute at the position that needs one, for example `BLANKVALUE(qty, 1)`.
- **A field is missing from the formula editor's Form fields list.** The editor never offers the field you are editing, a file upload field or a Date & time field. It offers an earlier step's repeated field only when that field is a number.
- **The editor says a field cannot go inside quotes.** A chip placed inside a quoted string would be stored as literal text. Move the chip outside the quotation marks, or remove them, then click **Apply formula** again.