--- title: "Set up mapping condition using an expression" slug: "set-up-mapping-condition-using-an-expression" description: "Learn how to apply record mapping conditions using expressions and variables to optimize message performance in your integration design." tags: ["Task topic"] status: "update" updated: 2026-10-05T12:03:12Z published: 2026-10-05T12:03:12Z canonical: "docs.staedean.com/set-up-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 mapping condition using an expression Sometimes, you want to skip a record mapping when running a message. You can use a condition that is defined as an expression to indicate if the record mapping must be applied. The record 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: Price>AmountCondition value: IF(Price>Amount, true, false)Variables: - Price is linked to SalesPrice field of the SalesLine source record. - Amount is linked to LineAmount field of the SalesLine source record. The record mapping is only applied if the sales price is higher than the line amount. For more information on expressions, refer to: [Expression](https://learn.microsoft.com/en-us/dotnet/api/system.data.datacolumn.expression?redirectedfrom=MSDN&view=net-5.0#System_Data_DataColumn_Expression). ### 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** pane, find and select the desired record. 5. In the **Condition** field, select '**Expression**'. 6. Click the **Mapping Condition** tab. 7. In the **Expression** field, enter the expression, using variables. 8. 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 only if the expression condition is not met. Select **Yes** in the **Invert condition** field. 9. 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. 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. 7. You can define the language in which the variable is expressed. In the **Language** field, type a value. > [!NOTE] > **Notes** > > Applying expression conditions can influence the message performance. So, only apply an expression condition if required and keep it as simple as possible. Some examples of a more complex condition expression. Note that both an 'AND' and 'OR' statement are used. > > - Example 1: Based on the values of 'role', 'email', and 'invoiceId', the record mapping is done or not. > > ![Mapping condition expression and variable details for data record processing.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MappingCondition_Expression_Example1.png) > - Example 2: Based on the values of the 'email' and 'invoiceId', the record mapping is done or not. ![Mapping condition expression for email and invoice ID in target record configuration.](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/MappingCondition_Expression_Example2.png) ## Related - [Set up record mapping](/set-up-record-mapping-flow.md) - [Set up record mapping](/set-up-record-mapping.md) - [Set up mapping conditions](/set-up-mapping-conditions.md)