# Calculated fields

Calculated fields are variables that can be used to create dynamic content, based on the answers from your respondents in your form. Think of calculating the price for a payment form, calculating the score of a quiz, or assigning a value such as a lead status to a respondent.

✔️ Create variables
✔️ Calculate scores & prices
✔️ Assign text values

🎁

## 1. Create a calculated field

Insert a calculated field in your form by typing `/calculated field`.
• Name your calculated field, to easily retrieve it in calculations later on
• Choose whether the value will be text or a numeric value
• Then add an initial value as a starting point of your calculation. This can also be zero or left blank.

## 2. Insert conditional logic

The value of a calculated field gets calculated by using conditional logic. Type `/logic` to insert conditional logic.

### The calculate action

Conditional logic allows you to perform multiple actions. When using calculated fields, we want to select the `Calculate` action.
You can perform numeric and textual operations with the Calculate action.

#### Numeric operations

• Subtract a value
• Multiply with a value
• Divide with a value

#### Textual operations

• Concatenate values: combine values in one string

### An example

In this example the respondent can choose between 2 products. When the respondent chooses "Apple" we want to add \$2 to our calculated field (the price). When the respondent chooses "Pear" we want to add \$3.
1. Add conditional logic using the Calculate function:
• When the answer to the question Choose a product contains the answer Apple (\$2)
• Then Calculate our calculated field Price and Add+ the value of 2
1. Repeat this for the answer option Pear (\$3)

## 3. How to use calculated fields

Calculated values are not by default visible in your form. You can find them in the results tab of your form, but you can also choose to display the calculated values in your form, use them in a payment form, or to create a dynamic redirect on completion.

#### Display a calculated field in your form

To mention your 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.

#### 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 the answers of your respondents.
1. Insert a payment form
1. The price will now automatically and in realtime be updated according to your respondent's answers

#### Dynamic redirect on completion

Use calculated fields to redirect respondents to different landing pages, based on their responses. You can do this by using a calculated field as your Redirect on completion link.
1. Insert a `calculated field` and name it (for example: URL).
1. Insert `Conditional logic` and assign a URL based on your conditions.

ℹ️
In this example we want to redirect respondents that choose "Pricing" to the landing page "acme.inc/pricing" and respondents that choose "News" to the landing page "acme.ince/blog" when they submit the form.

1. Go to form settings → `Redirect on completion` , click or type `@` and choose your calculated field from the dropdown menu.Redirect on completion
1.
4. Your form will now redirect respondents dynamically based on their responses. Tally