Links

What is a Calculated Property?

Understand how to use Calculated Properties in your Screens.

Overview

Use Calculated Properties to easily design formulas that perform calculations and solve problems within the context of a Screen. The output of a Calculated Property is automatically generated, read-only, and is available immediately in the Request data model. Advanced JavaScript developers can use Calculated Properties to do more advanced data manipulations.
Use Calculated Properties to add more context to your Screen display. A Request should never trust any data that originates from the client side, and trusted calculations should always be performed within a Request in a Script Task element.
Calculated Properties have the following attributes:
  • Calculated Properties can only be used within and only affect the Screen to which the Calculated Property is added.
  • Calculated Properties are generated values that cannot be edited after calculation.
  • The name of a Calculated Property is case sensitive. For example, netCost and NetCost are two distinct names for Calculated Properties.
Below are a few uses for Calculated Properties that can be calculated mathematically or through JavaScript:
  • Perform simple mathematics. Example: 1+1
  • Calculate the final cost of a purchase based on a sales tax. Example: $60 (item cost) x .075 (sales tax)
  • Calculate the minimum credit card payment. Example: $1000 (amount owed) x .03 (interest rate)
Reference the Screen control values for a Property using their Variable Name setting values. For example, to determine the cost for a number of items in a Screen for a purchase request form that uses a Line Input control with a Variable Name setting of units to indicate how many items to purchase, and price is the amount per unit, use the following calculation in a Property:
units * price
Calculated Properties display as the second key-value pair of the Screen's JSON data model from the Data Preview panel when previewing that Screen.
Last modified 3mo ago