Edit a Calculated Property for a Screen

Edit a Calculated Property for a Screen.

Edit a Calculated Property for a Screen

Permissions Required

Your user account or group membership must have the following permissions to edit a Calculated Property for a Screen:

  • Screens: Edit Screens

  • Screens: View Screens

See the Screens permissions or ask your Administrator for assistance.

Performance Recommendations

Avoid performance issues and follow best-use guidelines by following best practices.

Follow these steps to edit 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 Computer Properties screen displays all Calculated Properties for this Screen.

  3. Edit the following settings about the Calculated Property as necessary:

    • In the Property Name setting, edit 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.

    • In the Description setting, edit the description of the Calculated Property. This is a required setting.

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

        • Screen control value:

          Reference a Screen control's value by referencing that control's Variable Name setting to use it in a mathematical calculation. Example to calculate the total cost of a purchase: NetCost + ( NetCost * (SalesTaxRate/100)) when NetCost and SalesTaxRate are the Variable Name setting values for the two controls storing the net cost for a purchase prior to sales tax and the local sales tax rate, respectively.

        • 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. An underscore (_) character precedes all Magic Variables in the JSON data model. Example to get the ID for the user completing the current Task in that Request: _user.id.

      • 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 as described above for mathematical calculations. Reference the Magic Variable after the this. keyword when using JavaScript as the input method. Example: return this._user.fullname to reference the user's full name from the in-progress Request. See Magic Variable Descriptions.

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

  4. 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 edited until you save it. Doing so will save your work if your session expires.

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