--- title: "Set up field mapping condition using an expression" slug: "set-up-field-mapping-condition-using-an-expression" description: "Learn how to apply field mapping conditions using expressions and variables to optimize message performance in your integration design." tags: ["Task topic"] updated: 2026-08-24T08:40:40Z published: 2026-08-24T08:40:40Z canonical: "docs.staedean.com/set-up-field-mapping-condition-using-an-expression" --- > ## 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 field mapping condition using an expression Sometimes, you want to skip a field mapping when running a message. You can use a condition that is defined as an expression to indicate if the field mapping must be applied. The field mapping is only applied if the expression condition is met. You define an expression with self-defined variables. Variables must be linked to fields from the source document or the target document. **Example:** Expression: Value1>Value2 Condition value is shown as: IF(Value1>Value2, true, false) Variables: - Value1 is linked to SalesPrice field of the SalesLine source record. - Value2 is linked to LineAmount field of the SalesLine source record. The field mapping is only applied if the sales price is higher than the line amount. ### Steps 1. Click **Connectivity** **studio - Integration Design**. 2. On the **Message** tab, in the list, find and select the desired message. 3. Click **Edit**. 4. In the **Mapping** section, in the **Target record** list, find and select the desired record. 5. On the **Mapping** tab, on the **Field mapping** tab, in the list, find and select the desired field mapping. 6. In the **Use condition** field, select '**Expression**'. 7. Click the **Field condition** tab. 8. In the **Expression** field, enter the expression, using variables. 9. You can invert the condition of the expression. By default, if the expression condition is met, the record mapping is applied. If you invert the expression condition, the record mapping is applied if the expression condition is not met. Select **Yes** in the **Invert condition** field. 10. Sub-task: Define variables. 1. Add a variable line for each variable that is used in the expression. Click **New**. 2. In the **Variable** field, type exactly the variable name as used in the expression. 3. Define if the variable is linked to a field in the source document or target document. In the **Record origin** field, select an option. 4. Define the document record to which the variable is linked. In the **Record** field, enter or select a value. 5. Define the document record field to which the variable is linked. In the **Record field** field, enter or select a value. > [!NOTE] > **Note** > > The field type, as defined for the document record field, is shown as well. 6. Instead of a **Record field**, you can use a mapping variable as a variable in a field mapping condition. In the **Mapping variable** field, select a value. > [!NOTE] > Note > > - If you select a mapping variable, and you already selected a record field, the record field is removed. > - For more information on mapping variables, see: > - [Create mapping variables](/data-management/docs/create-mapping-variables) > - [Apply mapping variable (Field option)](/data-management/docs/apply-mapping-variable-field-option) 7. You can indicate how the variable value must be handled in the expression, regardless of the document record field type. In the **Variable type** field, select an option. 8. You can define the language in which the variable is expressed. In the **Language** field, type a value. 11. Close the page. > [!NOTE] > **Note** > > Applying expression conditions can influence the message performance. So, only apply an expression condition if required and keep it as simple as possible. ## Related - [Create mapping variables](/create-mapping-variables.md) - [Apply mapping variable (Field option)](/apply-mapping-variable-field-option.md)