Calculated Fields

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.

Calc_Advanced

Check off the calculated field checkbox.

Calc_CalcField

There are three components to the Math Feature used in the Short Answer field:

  • Numeric
  • Date
  • Text
Calc_Components

Numeric 

If you choose the numeric option, the calculated field will perform arithmetic operations on the fields that you select.

  1. Click the dropdown list under “Values”. This will show you all the form items that you’ve added to your form.
Calc_NumericDropdown
  1. Choose the fields that will be used in the calculation by selecting the form item and then clicking the ‘+’ button.
Calc_NumericDropdownSelect
  1. You will notice that the field item you selected will be in curly brackets and appear in the expression field
Calc_ExpressionBox
  1. 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 (“+”, “-“, “/”,”*”).
Calc_ExpressionCompleteBox
  1. Click Save at the bottom of the page.
  2. 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.
Calc_Numeric_Example
  • 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.
Calc_Rounding
  • 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.
Calc_Truncate

Text 

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.

  1. Select “Text” from the calculated field dropdown list
Calc_TextSetting
  1. Select the Form item that you want to copy in the dropdown 
Calc_TextDropdown
  1. Click on the “+” to add it to the expression field.
Calc_TextPlus
  1. The expression box will then display the field that you selected.
Calc_TextExpression
  1. Click save.

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.

  1. Select Text in the calculated field settings.
Calc_TextString
  1. Type in the text that you want to string together.
Calc_TextString_EnterExp
  1. 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.
Calc_TextStringExpressionComplete
  1. 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]
    • Click Save


 

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)