How to add a Calculated Field to a form
Calculated fields are used to calculate numeric entries on a form. By using calculated fields, manual calculations and errors are minimized. Results are displayed immediately, which helps users make informed decisions as a form is completed.
Any numeric field on a form can be used in a calculation including a time span field or other calculated field. Calculated fields can be used in static and dynamic tables, sections, repeatable groups, and conditional fields. For more information about using calculated fields see, Useful Tips about Calculated Fields.
To add a calculated field to a form:
- In the Form Designer, from the Input menu, add Number inputs to the form for which you want to add a calculated field.
- From the Actions/Container menu, click Calculated Field.
- A calculated field is added to the form.
- Click on it to view the Calculated Field input slider.
- In the Label field enter a label for the calculated field.
- Select the column span size for the calculated field.
- Expand Input Options. See Using Input Options for more information.
- The Replace Blank Field with 0 in Calculation option defaults marked. This option is used so that in complex calculations any number field in the calculation will use a zero in place of the blank to complete the transaction. For a simple calculation, you can decide whether using a zero makes a difference in the result and choose to use it or not.
- Click
(Edit Equation) to open the Equation window.
- Enter the equation you want calculated on the form by selecting the field you want to use and adding any functions to structure your calculation. Click OK.
-
Select Number or Duration as the display format. If you select Duration, specify the result and rounding options.
- Enter the number of decimal places the calculated amount will contain. The number of decimal places on the calculated answer does not need to match the number of decimal places on the numeric fields used to calculate the answer. On the mobile app, the decimals always show to this number even if they are zero.
- Enter a unit of measure that is displayed next to the number in the mobile app. The select whether you want the unit of measure text or symbol you type here to appear before or after the number. Units of measure are limited to 20 characters.
- If adding a calculated field to a dynamic table and using a summary row, you can hide the calculation label by marking the Hide Calculation Label option. This is useful when a column is narrow, and the label might wrap. It's obvious the row is a sum of the column so you can leave the label off that row.
- Expand Formatting Rules. See Adding Formatting Rules to Number Fields for more information.
- Expand Styles to specify the style settings for the calculated field. See Applying Styles to an Input for more information.
- Expand Validations to create a validation for the calculated field. See Creating Field Level Validations for more information.
- Save your entries.
- You can check your calculations in the Preview window by entering numbers in the associated fields to be sure they’re correct. If the equation is in error, #ERROR! or #NAME? is displayed under the calculation.