Configuring conditional mappings

To set the value of a target element conditionally in a Mapping node:
  1. In the Spreadsheet pane of the Message Mapping editor, select the target element and click Map > If.
    Two rows are added to the Spreadsheet pane, above the target element:
    • In the first row, Map Script is set to ‘if’. You cannot enter anything in the Value column of this row.
    • In the second row, Map Script is set to ‘condition’. Its value is an expression that is evaluated to see whether it is true. If true, the target element is set to the value specified in its ‘Value’ column. Initially, its Value column is set to ‘fn:true()’, which means that the condition is always met, and the target element is always set to the Value column.
  2. Change the expression in the condition row’s Value column by selecting the cell, or the condition row, in the Spreadsheet pane and setting the value in the Edit pane.
    Amend the expression in the Edit pane to specify the correct condition for the statement by performing the following steps:
    1. Select any database columns that are pertinent to the condition, and drag them from the Source pane into the Edit pane.
    2. Select any source message elements with values that are pertinent to the condition, and drag them from the Source pane into the Edit pane.
    3. Open Content Assist by clicking Edit > Content Assist and select the functions to be applied to the condition.
  3. Add further conditions by selecting the condition row in the Spreadsheet pane, and clicking Map > Condition.
    Two rows are added to Spreadsheet pane, below the target element:
  4. To set the value of a target element when the ‘If’ condition is not true, select the condition for the target element in the Spreadsheet pane, and click Map > Else.
    Two rows are added to Spreadsheet pane, below the target element:
Related tasks
Setting the value of a target element to a constant
Setting the value of a target element using an expression or function
Related reference
Message mappings