--- title: "Set up calculated fields for data entry workflow template" slug: "set-up-calculated-fields-for-data-entry-workflow-template" description: "Learn how to create calculated fields in data entry workflows, using variables and expressions for efficient data management in your templates." tags: ["Task", "Data Entry Wokflow", "DEW"] updated: 2026-09-23T08:28:37Z published: 2026-09-23T08:28:37Z canonical: "docs.staedean.com/set-up-calculated-fields-for-data-entry-workflow-template" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Set up calculated fields for data entry workflow template For a data entry workflow template, you can mark a field as a calculated field. The value of a calculated field is derived from a calculation expression, using variables that are mapped to other fields in the template. You can define both physical fields and virtual fields from the workflow document as calculated fields. You can also use both physical and virtual fields as variables in the calculation expression. You can use the following types of virtual fields as calculated field or in the calculation expression: - ‘Generic’ virtual field - Product attribute field (only if the **EcoResProduct** table is part of your workflow document records). - Purpose field (only if the workflow document record is related to one of these tables: **DirPartyLocation** or **LogisticsElectronicAddress**). - Inventory dimension field (only if the workflow document record has a relation to the **Inventory dimensions (InventDim)** table). > [!NOTE] > **Note** > > A calculated field is always shown as read-only on the related data entry workflow tasks. ### Steps 1. Go to **Data entry workflow** > **Design** > **Data entry workflow templates**. 2. In the list, click the link of the desired data entry workflow template. 3. Click **Edit**. 4. In the **Steps** section, in the tree, select the desired field group. 5. On the **Fields** tab, you can mark a field as a calculated field. In the grid, select the **Calculated field** check box. > [!NOTE] > **Note** > > - If you clear the **Calculated field** check box, the calculation setup for the field is disabled. > - To preserve the calculated value, consider marking the calculated field as **Non-editable**. 6. Sub-task: Set up variables. 1. To open the calculation expression setup, click **Calculation**. 2. In the **Variables** section, click **New**. 3. In the **Name** field, enter a short variable name. 4. Define which field value must be used for the variable. In the **Record field** field, select the desired field. 5. You can indicate how the variable value must be handled in the expression, regardless of the document record field type. Usually, the default variable type is used. The **Variable type** field, select an option. 6. You can define the language in which the variable is expressed. In the **Language** field, you can select a language. 7. Repeat these steps for each variable that you want to use in the expression. 7. Define the calculation expression. In the **Expression** field, define the expression, using variables. For more information on defining an expression, see [Expressions](/data-management/docs/set-up-calculated-fields#expressions). 8. Sub-task: Test expression. 1. Click **Test expression**. 2. Define test values for each variable. On the **Test expression** page, in the **Variables** section, in the **Value** field, enter a test value. > [!NOTE] > Note > > Usually, you use the default **Variable type** and **Language** as defined in the calculation setup. 3. Click **Execute**. 4. In the **Result** section, review the test result. 5. Close the page. 9. Close the page. ### Expressions In the calculation expression, you can use: - Variables: Add a defined variable by entering the variable **Name**. - Arithmetic operators: +, -, *, / - String functions like TRIM and SUBSTRING - Fixed values: You can enter a fixed value between single quotation marks. Example: ‘-’. For more information on expressions, see [Expressions](https://learn.microsoft.com/en-us/dotnet/api/system.data.datacolumn.expression?redirectedfrom=MSDN&view=net-5.0#System_Data_DataColumn_Expression). #### Expression examples: **Example 1:** Combine the product name and product description in one target field, divided by a hyphen. Variables: - a - Product name - b - Product description Expression: a+’-’+b **Example 2:** To add the packaging weight to a target field, you can subtract the net weight from the gross weight. Variables: - nw - Net weight - gw - Gross weight Expression: gw-nw **Example 3:** You want to remove all leading and trailing blank characters from customer names in D365 F&SCM. Variable: c - Customer Expression: TRIM(c) ## Related - [Edit fields](/edit-fields.md) - [Edit step fields - Data entry](/edit-step-fields-data-entry.md)