Calculating the value of a field

Use an expression to calculate the value of a field at run time.

For example, you can associate the Total Time field with an expression that adds together individual values, such as hours and minutes, or generates a subtotal from a list of time sheets.
  1. Access the field, based on the way that it is defined in your data model.
    • To view fields in a data type:
      1. In App Studio, click the Open runtime toolbar icon.
      2. Click Turn editing on.
      3. In the navigation panel, click Data to display the Integration Designer.
      4. Click the name of a data type.
      5. Click the Data model tab.
    • To view fields in a case type:
      1. In App Studio, click the Open runtime toolbar icon.
      2. Click Turn editing on.
      3. In the navigation panel, click Cases to display the Case Type Explorer.
      4. Click the name of a case type.
      5. Click the Data model tab.
      6. To display fields that are inherited by your application, click Show reusable fields.
  2. Click the Configure field icon in the row of a field.
  3. Select the This is a calculated field (read-only) check box. Not all field types support this display mode.
  4. Define a calculation by calling a function, referencing properties in an expression, or creating an advanced expression.
    • To call a function when the field stores a numeric value, such as an integer or decimal:
      1. Select an option in the Function list. For example, you can calculate an average or find a maximum value.
      2. In the Field list, select a single-value field that is defined in a repeating field group.
      3. Click Submit.
    • To reference a property from a numeric field:
      1. In the Function list, select Custom.
      2. In the smart prompt field, enter an expression without quotation makes that uses property names, function, dot notation, and mathematical symbols. Press the Down Arrow Key to see which properties you can reference.
      3. Click Submit.
    • To reference a property from a non-numeric field:
      1. In the smart prompt field, enter an expression without quotation makes that uses property names, function, dot notation, and mathematical symbols. Press the Down Arrow Key to see which properties you can reference.
      2. Click Submit.
  5. Click Submit.
At run time, the field is displayed in read-only mode. Your application evaluates the expression and stores the results in the property that is associated with the field.