Calculation Field Guide

Overview of the Calculation Feature

The Calculation feature lets you automatically calculate values within a form based on answers entered by users. You can use it to create subtotals, combine multiple subtotals into a final total, or perform simple calculations using values from different fields.

For example, you can assign numeric values to answers such as Yes, No, or N/A, then use those values to calculate a score or total. You can also use numbers entered in a field or the result of another Calculation field as part of a formula.

Note: The Calculation field is available in Form Builder, which is currently accessible only in the GoBuid Web App.

In this article

  • What you can use in a Calculation
  • How choice fields work with Calculation
  • How text fields work with Calculation
  • Adding a Calculation field
  • Selecting fields for a calculation
  • Building a formula
  • Creating subtotals and final totals
  • How the calculated result is displayed
  • Example use cases
  • Known limitations

What you can use in a Calculation

Calculation fields can use values from different types of fields in your form.

You can use:

  • Choice fields, such as Single Selection, Multiple Selection, and Dropdown, when numeric values have been assigned to their answer options.
  • Text fields set to the Number format.
  • Other Calculation fields when combining subtotals or creating a final total.

These fields provide the values that GoBuid uses when calculating the result.

How choice fields work with Calculation

Choice fields can be used in a calculation when each answer option has been assigned a numeric value.

For example, you can assign:

  • Yes = 1
  • No = 0
  • N/A = 0

To use a choice field in a calculation:

  1. Select the choice field in Form Builder.
  2. Open the field Settings.
  3. Go to the Advanced tab.
  4. Turn on Calculation.
  5. Assign a numeric value to each answer option.

Once values have been assigned, the field becomes available when selecting fields for a Calculation.

Choice fields without assigned values will not appear in the field selection list.

For Multiple Selection fields, if a user selects multiple answers, GoBuid adds the assigned values of all selected answers together and uses the total in the calculation.

How text fields work with Calculation

Text fields can also be used in a Calculation as long as their Format is set to Number.

No additional value needs to be assigned. The number entered by the user is used directly in the calculation.

For example, if a user enters 25 in a Number field, that value can be selected as part of a Calculation formula.

Adding a Calculation field

To add a Calculation field to your form:

  1. Open Form Builder.
  2. Drag and drop a Calculation field into your form.
  3. By default, the field is labelled Total.
  4. Change the label to match what you are calculating, such as Subtotal, Total Cost, or HSES Score.
  5. Open the field settings and use the formula editor to build your calculation.

The field label only changes how the result is displayed. It does not affect how the calculation works.

Selecting fields for the calculation

When building your formula, click Add Field to select the fields you want to use.

The field selection works as follows:

  • Select the Page (Section) where the field is located.
  • By default, the current page is selected.
  • You can switch to another page to find fields from other sections.
  • Only eligible fields are shown, such as choice fields with assigned values, Number-format text fields, and other Calculation fields.
  • Fields such as signatures, file uploads, dates, and heading or text blocks are not available for selection.
  • Use the search function to quickly find a field.
  • You can select multiple fields at once. Selected fields are automatically joined using +.

For fields inside a Table, each row is treated as an individual field. This allows you to select specific rows or use search and Select All to add multiple rows at once.

Building a formula

Calculation supports simple mathematical operations that you can combine to create a formula.

You can use:

  • Addition (+)
  • Subtraction (-)
  • Multiplication (ร—)
  • Division (รท)
  • Parentheses ( ) to control the order of the calculation

For example:

Subtotal + Delivery Fee

or:

(Quantity ร— Unit Price) + Service Fee

Formula rules

When entering a formula:

  • Numbers can contain up to 10 digits before the decimal point.
  • Numbers can contain up to 2 decimal places.
  • A formula cannot end with an operator.
  • Two operators cannot be placed next to each other.
  • Two numbers or fields must have an operator between them.
  • Parentheses must be properly balanced.

When a formula contains an error, the affected part is highlighted and an error message explains what needs to be corrected.

Common formula errors

Situation Message shown
Two operators are placed together Consecutive operators are not allowed. Remove or replace one.
Formula ends with an operator Formula cannot end with an operator. Add a number or field after it.
Two numbers or fields are placed together Consecutive numbers are not allowed. Add an operator between them.
Number format is invalid Must be within 10 digits and only 2 decimal places.
Formula is invalid Unable to calculate due to invalid formula.
A referenced field has been deleted This field no longer exists. Please select a valid field.

Creating subtotals and final totals

You can use Calculation fields to create both subtotals and final totals. There is no separate field type for each one.

Subtotal

Use a Calculation field to combine related values on the same page.

For example:

Main Course Cost + Beverage Cost + Service Fee = Subtotal

You can then label the Calculation field Subtotal.

Final Total

You can create another Calculation field that references the subtotal fields created earlier.

For example:

Subtotal 1 + Subtotal 2 + Subtotal 3 = Final Total

Label this field Final Total.

Calculation fields can reference other Calculation fields, allowing you to build calculations across multiple pages or sections.

GoBuid also prevents circular references. For example, if Calculation A references Calculation B, Calculation B cannot reference Calculation A. A field that would create this type of loop is shown as unavailable when selecting fields.

How the calculated result is displayed

You can control how the calculated result is displayed in the field's Advanced settings.

You can:

  • Choose to display 0, 1, or 2 decimal places.
  • Use standard rounding for the displayed result.
  • Turn on Set Maximum and enter a maximum value.

When Set Maximum is enabled, any result that exceeds the maximum value will be recorded and displayed as the maximum value instead of the higher calculated result.

If a formula is incomplete, contains an error, or references a field that does not have a value yet, the Calculation field remains empty instead of displaying an incorrect result.

Example use cases

Example 1: Calculate a subtotal

A form contains three Number fields:

  • Main Course Cost
  • Beverage Cost
  • Service Fee

Add a Calculation field named Subtotal and use:

Main Course Cost + Beverage Cost + Service Fee

The result is automatically calculated as the user enters the values.

Example 2: Calculate a final total

A form contains multiple pages, each with its own Subtotal Calculation field.

Add another Calculation field named Final Total and select the subtotal fields from each page.

Use:

Subtotal 1 + Subtotal 2 + Subtotal 3

The Calculation field displays the combined total across all pages.

Example 3: Count quantities in a Table

You can also use Calculation to count selected answers in a repeating Table.

For example, a Table contains 10 rows with two Single Selection fields:

  • Main Course
  • Beverage

Each field has the following choices:

  • Y = 1
  • N = 0
  • NO = 0

To calculate the total number of main courses:

  1. Assign the calculation values to the Main Course choices.
  2. Add a Calculation field named Main Course Count.
  3. Select all 10 Main Course rows.
  4. The selected fields are automatically joined using +.
  5. The result represents the total number of rows where Y was selected.

Repeat the same process for Beverage Count.

You can then create another Calculation field named Total Count and use:

Main Course Count + Beverage Count + 1

The 1 is a fixed value entered directly into the formula.

๐Ÿ’ก Quick Tip

For fields inside a Table, you can use Search and Select All to quickly add all matching rows to your calculation instead of selecting each row individually.

Important points to remember

  • The numeric value assigned to a choice belongs to that field and is used every time that field is referenced in a calculation.
  • You cannot assign different numeric values to the same choice field depending on which Calculation field is using it.
  • Every row in a Table is treated as a separate field and can be selected individually.
  • Calculation fields can reference other Calculation fields to create subtotals and final totals.
  • GoBuid prevents circular references between Calculation fields.

Known limitations

Calculation currently supports simple calculations only.

  • Only addition, subtraction, multiplication, division, and parentheses are supported.
  • Functions such as SUM and ROUND are not supported.
  • Exponents and comparison operators are not supported.
  • There is currently no dedicated error message for division by zero, so formulas should avoid dividing by a value that could be zero.
  • Currency formatting, payment calculations, and exchange-rate conversion are not supported.
  • Existing submissions created before the Calculation feature was introduced will not be recalculated automatically and may display an empty result.