Add a Calculated Property for a Screen

Add a Calculated Property to a Screen.

Add a Calculated Property

Permissions Required

Your user account or group membership must have the following permissions to add a Calculated Property for a Screen unless your user account has the Make this user a Super Admin setting selected:

  • Screens: Edit Screens

  • Screens: View Screens

See the Screens permissions or ask your Administrator for assistance.

Follow these steps to add a Calculated Property for a Screen:

  1. Open the Screen in which to add a Calculated Property. The Screen is in Design mode.

  2. View the Calculated Properties for that Screen. The Calculated Properties screen displays all Calculated Properties configured for this Screen. If no Calculated Properties have been configured for this Screen, No Data Available displays.

  3. Click the +Property button. The Calculated Properties screen displays settings to configure a Property.

  4. In the Property Name setting, enter the name of the Calculated Property. This Calculated Property name displays both in the Calculated Properties screen and in the JSON data model when previewing the Screen. Calculated Properties are case-sensitive. See Calculated Property Best Practices. This is a required setting.

  5. In the Description setting, enter the description of the Calculated Property. This is a required setting.

  6. Above the Formula setting, select one of the following ways to determine how the Calculated Property determines its value:

    • Follow these guidelines to reference Screen control or Magic Variable values:

      • Screen control value:

        Reference a Screen control's value by referencing that control's Variable Value setting. Example: return this.FullName when FullName is the Variable Value setting value for the control to reference its value when the Calculated Property runs.

      • Magic Variable value:

        Reference a Magic Variable's value. ProcessMaker Platform uses a set of Magic Variables that become part of the JSON data model for all Requests. ProcessMaker Platform uses these Magic Variables to store user, Process, and Request related data for all Requests. During an in-progress Request, these Magic Variables are updated. All Magic Variables are preceded by an underscore (_) character in the JSON data model. Reference the Magic Variable after the this. keyword. Example: return this._user.fullname to reference the user's full name from the in-progress Request. See Magic Variable Descriptions. Note that there is no Magic Variable that stores the user that starts a Request. To address this, use a Calculated Property to reference the _user.fullname Magic Variable's value in the Screen referenced in the first Task element of a Process; since many Processes are designed such that the Request starter is the user assigned the first Task in a Request, this is a helpful way of storing who the Request starter is. This Calculated Property stores this Magic Variable's value, which you may reference elsewhere.

  7. In the Formula setting, enter the mathematical calculation/JavaScript that determines the Calculated Property value. This is a required setting.

  8. Click Save. The Property displays in the Calculated Properties screen. The following message displays: Property Saved.

Ensure to save your Screen. The Calculated Property is not added to your Screen until you save it. Doing so will save your work if your session expires.

pageWhat is a Calculated Property?pageView Calculated Properties for a ScreenpageEdit a Calculated Property for a ScreenpageDelete a Calculated Property from a ScreenpageCalculated Property Best PracticespageWhat is Screen Builder?pageScreen Builder ModespageControl DescriptionspageView ScreenspageScreen TypespageValidate Your ScreenpageAdd, Delete or Rename a PagepageAdd Custom CSS to a ScreenpageManage WatcherspagePublish Your ScreenpageScreen Design Best Practices

© Copyright 2000-2024 ProcessMaker Inc. All rights reserved.