Creating a calculated field
Save time and improve the accuracy of the information in your case processing by creating a calculated field that automatically returns a value based on the input data. For example, you can create a field that calculates a length of stay at a hotel based on arrival and departure dates that a user provides.
- Navigate to a place where you want to add a calculated field:
Choices Actions Add a calculated field to a case type - In the navigation pane of App Studio, click Case types, and then click the case type that you want to open.
- Click the Data model tab, and then click Add field.
Add a calculated field to a data object - In the navigation pane of App Studio, click Data.
- Click the data object that you want to open.
- Click the Data model tab, and then click Add field.
- In the Add field modal dialog box, in the Field name field, enter the name of the new field.
- In the Type field, select a field type that supports calculations, for example, Integer.
- Expand the Advanced section, and then select the
This is a calculated field (read-only)
checkbox.The checkbox is visible only for fields that support calculation.
- Define how an application calculates the field value:
Choices Actions Calculate a value by using an expression - In the Calculation section, in the Function list, select Use expression.
- In the text field, enter an expression that you want to apply.
Calculate a value by using a custom decision table - In the Calculation section, in the Function list, select Use decision table.
- In the drop-down list, select Custom decision table, and then click the Gear icon.
- In a dialog box that opens, configure your decision
table.For more information, see Calculating values with decision tables.
- Click Submit.
Calculate a value by using an existing decision table - In the Calculation section, in the Function list, select Use decision table.
- In the drop-down list, select Existing decision table, and then select the decision table that you want to use.
- Click Submit.
Calculate a value of a currency, decimal, integer, or percentage field by using a function - In the Calculation section, in the Function list, select a type of a function that you want to apply.
- In the Field list, select a single-value field from an embedded data field in your data model.
- Click Submit.
- Click Save.
Previous topic Adding single-value fields to forms Next topic Field values