Configuring a repeating source and a non-repeating target

To map a repeating source element to a non-repeating target element, drag elements between the Message Mapping editor Source and Target panes. The following items appear in the Spreadsheet pane:

The first occurrence of the source field is mapped to the target field. The ‘for’ row specifies that a loop is to be iterated for the specified repeating element. The ‘if’ and ‘condition’ rows restrict the logic to a single occurrence of the repeating element (see Configuring conditional mappings for more information on conditional logic in a mapping node).

  1. To map an occurrence other than the first, change the expression in the ‘condition’ row to msgmap:occurrence($source/…) = n, where n is the occurrence that you want to map.

    If the repeating source field is within one or more repeating structures, a hierarchy of ‘for’, ‘if’, and ‘condition’ rows is placed in the Spreadsheet pane, one for each level of repetition.

  2. If the source and target fields contain numeric data types, mapping all occurrences of a repeating source field to a non-repeating target results in the sum of all the source elements. Perform this mapping by selecting the source element and target element and clicking Map > Accumulate.
    This action sets the following value in the Spreadsheet pane for the target element:
    fn:sum($source/…)
    You cannot map different occurrences of a repeating source element to different non-repeating target elements.
Related concepts
Message Mapping editor
Creating message mappings
Related tasks
Configuring conditional mappings
Related reference
Message Mapping editor Source pane
Message Mapping editor Target pane
Message Mapping editor Spreadsheet pane
Message mappings