--- title: "Calculated Properties" slug: "calculated-properties" updated: 2024-09-22T20:39:35Z published: 2024-09-22T20:39:35Z canonical: "docs.processmaker.com/calculated-properties" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.processmaker.com/llms.txt > Use this file to discover all available pages before exploring further. # Calculated Properties > [!TIP] > [**Plan Availability:**](https://www.processmaker.com/products/pricing/) ![Professional](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/Standard.png)![Professional](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/Professional.png)![Enterprise](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/Enterprise.png) ## What are Calculated Properties? 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. > [!WARNING] > 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. > [!TIP] > **What new in Summer 2024** > > - Organize Calculated Properties easily with drag-and-drop functionality. > - Temporarily disable specific Calculated Properties when necessary. > - Access detailed logs to troubleshoot runtime errors with precision. > - Enjoy expanded editing space in the editor, enhancing your ability to work with Calculated Properties. > > [Embedded content](https://cdn.iframe.ly/G7AdxRI) ### Use Cases Here are a few uses for Calculated Properties that can be calculated mathematically or through JavaScript: - Perform mathematical calculations. Example: `sqrt(350/25)*0.5` - Calculate the final cost of a purchase based on a sales tax. Example: `60(item cost)*.075 (sales tax)` - Calculate the minimum credit card payment. Example: `1000(amount owed)*.03(interest rate)` To reference Screen controls in a Calculated Property, use their Variable Name setting. For example, to determine the cost for a number of items in a Screen that uses a Line Input controls with a variable name `units `and `price`, 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. > [!NOTE] > [See best practices when using Calculated Properties](/v1/docs/calculated-property-best-practices) ## View the Calculated Properties for a Screen **Permissions** Your user account or group membership must have the following permissions to view the Calculated Properties 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](/v1/docs/permission-descriptions-for-users-and-groups#screens) permissions or ask your Administrator for assistance. Follow these steps to view the Calculated Properties for a [Screen](/v1/docs/screens): 1. [Open](/v1/docs/manage-screens#edit-a-screen) the Screen in which to view its Calculated Properties. The Screen is in Design mode. 2. Click the **Calcs** button![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(164).png). to view all Calculated Properties configured for this Screen. ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(157).png) 3. The following information displays about each Calculated Property: 1. **Property name:** The **Property Name** column displays the name of the Calculated Property. 2. **Description:** The **Description** column displays the description of the Calculated Property. 4. Use the move icon ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(158).png)to change the order in which Calculated Properties are displayed in this list. ## Add a Calculated Property **Permissions** 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](/v1/docs/permission-descriptions-for-users-and-groups#description-of-platform-permissions) permissions or ask your Administrator for assistance. Follow these steps to add a Calculated Property for a Screen: 1. [View the Calculated Properties for a Screen.](/v1/docs/calculated-properties) 2. Click the **+Property** button. The **Calculated Properties** screen displays settings to configure a Property. 3. 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. This is a required setting. 4. In the **Description** setting, enter the description to explain the purpose of the Calculated Property. This is a required setting. 5. From the **Formula** setting, select **Formula** icon ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(166).png)to enter the value, or mathematical calculation that calculates the property. The Formula icon is selected by default. 6. From the **Formula** setting, click the **JavaScript** icon ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(165).png)to calculate the property using JavaScript. Using this option allows for referencing the values for Screen controls or [Magic Variables](/v1/docs/magic-variables). ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(167).png) ## Best Practices and Examples ### Using Formulas Use formulas to quickly apply mathematical calculations. For example, the following formula calculates the total cost of a purchase: `Price + ( Price * (SalesTaxRate/100))` where Price and SalesTaxRate are the Variable Names for two Screen controls. ### Using JavaScript Use JavaScript for more complex calculations or small snippets of code. - For example, use the following code to obtain the current date for a control `let currentDate = new Date().toDateString(); ` `return currentDate;` - Use a `return `[statement](https://www.w3schools.com/jsref/jsref_return.asp) to return the result of an expression. For example, `return TotalPrice` - Ensure to use `this `[JavaScript keyword](https://www.w3schools.com/js/js_this.asp) when referencing Screen controls. - For example: use `this.email` - ,where email is the Variable Value for the control storing the email address for a user. ### Using Magic Variables in JavaScript [Magic Variables](/v1/docs/magic-variables) store important data about a Request and are a part of the JSON data model. These variables store information like User name, Process name, and Request ID, etc. All Magic Variables are preceded by an underscore (`_`) character in the JSON data model. Use the following syntax to reference a Magic Variable in a Calculated Property:`return  this._user.fullname` to reference the user's full name from the in-progress Request. See Magic Variable Descriptions. There is no Magic Variable that stores the user who 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 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. ## Edit a Calculated Property for a Screen **Permissions** 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](/v1/docs/permission-descriptions-for-users-and-groups#description-of-platform-permissions) permissions or ask your Administrator for assistance. Follow these steps to edit a Calculated Property for a Screen: 1. [View the Calculated Properties for a Screen.](/v1/docs/calculated-properties) 2. Click the **Edit** icon ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(169).png)for the Calculated Property to edit. The Calculated Properties screen displays that Calculated Property's name, description, and how its value is determined. ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(170).png) 3. Edit the settings as necessary and click **Save**. ## Bypass a Calculated Property Temporary disable a Calculated Property by using the bypass option. Follow these steps to bypass a Calculated Property: 1. [View the Calculated Properties for a Screen.](/v1/docs/calculated-properties) ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(161).png) 2. Click the Bypass icon ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(162).png) for the Calculated Property to temporarily disable it. 3. Click the UnBypass icon ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(163).png)to enable the Calculated Property. ## View Logs for a Calculated Property View developer logs to troubleshoot runtime issues and errors. Follow these steps to view the logs: 1. When testing a Calculated Property in Screen Preview mode or viewing the Screen in a Case, use the browser function to view the Developer Tools. 2. Locate any warnings or errors using the name of your Calculated Property in the Developer Tools to verify if it has successfully run. ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(160).png) ## Delete a Calculated Property **Permissions** Your user account or group membership must have the following permissions to delete a Calculated Property from a Screen: - Screens: Edit Screens - Screens: View Screens See the [Screens](/v1/docs/permission-descriptions-for-users-and-groups#screens) permissions or ask your Administrator for assistance. > [!WARNING] > When a Calculated Property is deleted, in-progress Cases using that Calculated Property are not affected. However, the Calculated Property cannot be referenced in new Cases or other Process models afterward. > > Deleting a Calculated Property from the Calculated Properties page is irreversible Follow these steps to delete a Calculated Property from a Screen: 1. [View the Calculated Properties for a Screen.](/v1/docs/calculated-properties) ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/image(159).png) 2. Click the **Delete** icon ![](https://cdn.document360.io/2d311614-fcb7-4424-8b4c-d4d3091eebeb/Images/Documentation/7590d08a-26d7-44e4-a291-85f075449eb9.png) for the Calculated Property to delete. The Calculated Property is deleted, and the following message displays: **Property deleted**.