Skip to main content Skip to complementary content

Mapping two inputs to a single output

Configure your map to combine two parallel loops into nested loops.

Procedure

  1. Drag and drop the input row1Record element to the output customer element to automatically map the id, name and city elements.
  2. Click the output bill element and drop a SimpleLoop function in its Loop tab, then drop the input row2Record element on the Input Map Element argument.
  3. Drop an Equal function on the Filter argument, then drop the input customerId element on the First Value argument, and the output customer/id on Second Value.

    Example

  4. Drag and drop the input billId on the output bill/id and the input price on the output price.
  5. Save your map, then open the Job in the Integration perspective, go to the Run tab and run the Job.

Results

The output file is generated in the location specified in the tFileOuputRaw component. It should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<root>
   <customer>
      <id>111</id>
      <name>John</name>
      <city>New York</city>
      <bill>
         <id>asd-589</id>
         <price>123.58</price>
      </bill>
   </customer>
   <customer>
      <id>591</id>
      <name>Billy</name>
      <city>Los Angeles</city>
      <bill>
         <id>sry-84u</id>
         <price>352.89</price>
      </bill>
      <bill>
         <id>xoi-htr</id>
         <price>36.55</price>
      </bill>
   </customer>
   <customer>
      <id>891</id>
      <name>Bob</name>
      <city>Chicago</city>
      <bill>
         <id>111-gfs</id>
         <price>3.58</price>
      </bill>
      <bill>
         <id>8j9-t44</id>
         <price>99.95</price>
      </bill>
      <bill>
         <id>999-gre</id>
         <price>799.95</price>
      </bill>
   </customer>
</root>

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!