Skip to main content
Calculated fields in HoopAI forms let you perform math operations based on user input — perfect for price calculators, ROI tools, BMI calculators, and quoting engines.

Adding a calculated field

1

Open the form builder

Go to Sites → Forms & Surveys and create or edit a form.
2

Add input fields

Add the fields that will feed into your calculation (Number fields, Dropdown fields with numeric values, etc.).
3

Add a calculated field

Drag a Calculation or Computed element onto the form. This field displays the result of a formula.
4

Write the formula

In the calculated field settings, write your formula referencing other fields by their field ID.

Basic arithmetic

OperationSyntaxExample
Additionfield_1 + field_2Total price = base + shipping
Subtractionfield_1 - field_2Discount = price - savings
Multiplicationfield_1 * field_2Total = quantity * unit_price
Divisionfield_1 / field_2Per-unit cost = total / quantity
Parentheses(field_1 + field_2) * field_3Group operations for order of precedence
Constantsfield_1 * 0.08Tax = subtotal * 8%

Referencing other fields

Use the field’s ID (not the label) in your formulas. Find the field ID in the field’s settings panel. Example: If you have a Number field with ID quantity and another with ID unit_price:
quantity * unit_price
The calculated field updates in real time as the user types.

Conditional calculations

Use conditional logic to apply different formulas based on user selections:

Example: Tiered pricing

If a dropdown field plan_type has values “Basic”, “Pro”, and “Enterprise”:
  • Basic: $29/mo
  • Pro: $79/mo
  • Enterprise: $199/mo
Set up the dropdown with numeric values assigned to each option, then multiply by the quantity or duration field.

Example: Discount tiers

Apply different discount rates based on quantity:
  • 1–10 units: no discount
  • 11–50 units: 10% discount
  • 51+ units: 20% discount
Use conditional visibility on multiple calculated fields, or use the form’s conditional logic to show different results.

Displaying results

Display optionHow
As a numberThe raw calculated value
As currencyFormat with $ prefix and 2 decimal places
As percentageFormat with % suffix
HiddenCalculate but do not show (useful for intermediate values)
Configure the display format in the calculated field’s settings.

Use cases

Fields: Product dropdown, Quantity (number), Add-ons (checkboxes)Formula: (product_price * quantity) + addon_totalShows the total cost in real time as the customer builds their order.

Limitations

  • Calculated fields are computed client-side (in the browser) and update in real time
  • Complex multi-step formulas may need to be broken into intermediate calculated fields
  • Trigonometric and advanced math functions may not be available — use basic arithmetic
  • Calculated field values can be submitted with the form and stored as contact custom field values
  • Precision is limited to standard floating-point arithmetic (minor rounding differences possible)
For complex calculations that exceed the built-in formula capabilities, use a custom JavaScript snippet in the form’s custom code section.

Tips

Use multiple calculated fields to show subtotal, tax, discount, and total separately. This builds trust and transparency.
If your formula is complex, break it into smaller calculations using hidden calculated fields, then reference them in the final visible result.
Enter zero, very large numbers, and negative numbers to make sure your formula handles them correctly.
Last modified on March 6, 2026