Calculated fields are variables you can use to create dynamic content based on respondents’ answers. Think: calculating the price for a payment form, adding up a quiz score, or assigning a value such as a lead status to a respondent.
Calculated fields are available for free to all Tally users.
Calculated fields examplesCreate a calculated fieldInsert conditional logicAdd calculate actionNumeric operationsTextual operationsCalculated fields setupHow to use calculated fieldsDisplay a calculated field in your formDynamic pricing in a payment formRedirect to different URLs and Tally formsDynamic email notifications
Calculated fields examples
Calculated fields enable you to dynamically calculate values based on respondents' answers. Here are some common use cases for calculated fields:
- Scoring quizzes with points assigned to each answer and tallied for the final score.
- Personality or category quizzes that assign an outcome based on the most answered category.
- Pricing calculators with checkout forms that allow respondents to select products or services and then calculate the total cost dynamically.
- Conditional redirects that use a calculated field with conditional logic to redirect respondents to different pages based on their responses.
- Lead qualifications that assign a lead status or label based on respondents’ answers.
Create a calculated field
Insert a calculated field in your form by typing
/calculated field
. In most cases, it’s best to add calculated fields on top of the form.- Name your calculated field to easily retrieve it in calculations later on
- Choose whether the value will be text or a numeric value (number)
- Then, add an initial value as a starting point of your calculation. This can be zero (for numbers) or left blank (for text).
Insert conditional logic
Before determining the value of a calculated field, you need to add conditional logic to your form. Type
/logic
to insert it below your calculated field block. Only you can see the calculated field and conditional logic blocks—respondents won’t see them on your published form.
Add calculate action
Conditional logic allows you to perform multiple actions. When using calculated fields, you want to select the
Calculate
action.You can perform several numeric and textual operations with the
Calculate
action:Numeric operations
- Add a value
- Subtract a value
- Multiply with a value
- Divide with a value
Textual operations
- Assign: add a text value, for example, a label or a status, to sync contacts from your form submissions with a CRM or another tool or assign a category name to respondents based on their selected answers. Respondents won’t see this information unless it’s mentioned elsewhere in the form.
- Concatenate values: combine values in one string. For example, if you have fields for first name and last name in your form, you can create a calculated field that combines the values entered in these two fields into a single ‘Full name’ field. To use this, you need to select
Text
when creating a calculated field.
Calculations on date blocks are not available yet.
Calculated fields setup
In this example, the respondent can choose between two products. When they choose "Apple", we want to add $2 to our calculated field (the price). When the respondent chooses "Pear", we want to add $3.
Follow the steps below to set up this calculated fields example:
- Add a
Checkbox
block with two product options by typing/checkboxes
and giving it a “Choose a product” title or label
- Insert a
Calculated fields
block by typing/calculated fields
- Add a field name (”price”)
- Select
Number
- Leave the initial value field blank or type zero
- Add
Conditional logic
and use the Calculate function: - When the answer to the question Choose a product contains the answer Apple ($2)
- Then Calculate the calculated field Price and Add+ the value of 2
- Repeat this for the answer option Pear ($3)
Once you’ve set this up, read our guide below on using the calculated fields and making them visible to your respondents.
If you’re looking for product checkout templates, view our simple or advanced checkout templates.
How to use calculated fields
By default, calculated values are not visible in your form. You can find them in the
Submissions
tab of your form, but you can also display the calculated values in your form, use them in a payment form, or create a dynamic redirect on completion.Display a calculated field in your form
To mention the calculated value in your form, simply type
@
and choose the calculated field from the dropdown menu. You can use this to show a final price, score or quiz result in your form.If you want to calculate and display currency, add your currency symbol directly before the linked calculated field, like in the example below.
Dynamic pricing in a payment form
You can use a calculated field to calculate the price of your payment form and make it dynamic based on your respondents’ answers. This means the price will change based on other inputs and logic.
- Type
/payment
to insert a payment form.
- Choose your calculated field from the
Price
dropdown menu in your payment block.
- The price will now automatically update according to your respondent's answers, for example, if they select different product types or quantities.
Redirect to different URLs and Tally forms
You can redirect respondents to different websites, landing pages, or Tally forms upon form completion. For this, you’ll need to use calculated fields and conditional logic.
You can also add hidden blocks to allow respondents to enter additional information before leaving the form for more comprehensive and trackable lead capture. As a result, the form creates an interactive landing page-like experience.
To learn more about redirecting to different URLs, read our redirect on completion guide.
Dynamic email notifications
You can use calculated fields to customize the email body or recipients of your respondent or self email notifications. Learn more about dynamic email notifications here.