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:
Open the Screen in which to add a Calculated Property. The Screen is in Design mode.
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.
Click the +Property button. The Calculated Properties screen displays settings to configure a Property.
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.
In the Description setting, enter 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:
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
whenFullName
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 thethis.
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.
In the Formula setting, enter the mathematical calculation/JavaScript that determines the Calculated Property value. This is a required setting.
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.
Related Topics
What is a Calculated Property?View Calculated Properties for a ScreenEdit a Calculated Property for a ScreenDelete a Calculated Property from a ScreenCalculated Property Best PracticesWhat is Screen Builder?Screen Builder ModesEdit Your ScreenView ScreensScreen TypesValidate Your ScreenAdd, Delete or Rename a PageAdd Custom CSS to a ScreenManage WatchersPublish Your ScreenScreen Design Best and Worst PracticesLast updated