How to Configure Calculated Fields
A calculated field allows you to apply a formula on one or more fields on the form. For instance, you can create a calculated field that sums up two form item fields. Below, we will illustrate the basics of using calculated fields and show several examples.
The short answer form item is the only item that allows for calculated field.
Drag and drop the short answer form item to your form and click on the advanced option to open its configuration.
Check off the calculated field checkbox.
There are three components to the Math Feature used in the Short Answer field:
If you choose the numeric option, the calculated field will perform arithmetic operations on the fields that you select.
- Click the dropdown list under “Values”. This will show you all the form items that you’ve added to your form.
- Choose the fields that will be used in the calculation by selecting the form item and then clicking the ‘+’ button.
- You will notice that the field item you selected will be in curly brackets and appear in the expression field
- You can add the arithmetic operations (“+”, “-“, “/”,”*”) that you want to perform in the expression box. Please ensure you have a space before and after each arithmetic operations (“+”, “-“, “/”,”*”).
- Click Save at the bottom of the page.
- Now, the field you selected will perform the arithmetic function that you entered. For instance, in our example, CreditHour1 will display the sum of CreditHour2 and CreditHour.
- Rounding (optional - defaulted to none) - You can select none or 0-5 decimal places. If you choose 0 then the value will be rounded to the nearest whole number. If you choose 2 decimal places, then the value will be rounded to the nearest hundredth decimal place.
- Truncation (Optional – Defaulted to None) – You can select none or 0-5 decimal places. If you choose 0 it will only show the whole number with no decimal places. If you choose 2 decimal places, it will truncate or remove the remaining numbers after the 2 decimal places.
Replicating a form item response to be used elsewhere in the form.
You can display the contents of a form item again by using the calculated field feature.
- Select “Text” from the calculated field dropdown list
- Select the Form item that you want to copy in the dropdown
Click on the “+” to add it to the expression field.
The expression box will then display the field that you selected.
The form item that you applied this to will then copy the value of the form item that you referenced in the expression box.
Stringing form items together
The calculated field can also be used to string together form items as text and/or values that were inputted in the form.
Select Text in the calculated field settings.
Type in the text that you want to string together.
Select the field that you want to be strung together with the text you typed using the dropdown list and the “+” button. Remember that the form item fields you selected will appear in curly brackets, while the text that you type will appear without the curly brackets.
Now the textbox will string together the form items that you selected and the text that you entered.
Current Date prefill
Prefill Short Answer form item with Current Date, so as soon as a Participant accesses the form the Current Date will be prefilled.
Select Short Answer Form Item > Advanced > Calculated Field (checkbox) > Type = Date
Value 1 = [Current Date]
For more details around calculated fields and examples of how to use Dates, please see Nextgen Dynamic Form help-site: https://nextgenweb.screenstepslive.com/m/64464/l/1111441-math-feature-calculated-short-answer-item (Must SSO/CAS in to access the page)