Mapping issue with duplicates in destination schema
I have an input schema similar to this:Header
--itemNumber
Detail
--lineItemNum
--Status
I am mapping to a schema similar to this:
root
----itemNumber
----Notes
Item number maps straight across. lineItemNum and Status are concatenated and separated via a comma and each loop on detail is separated by a ~. I am using a concatenate functoid with 4 parameters: lineItemNumber, ",", Status, and '~'. I am then using a cumulative concatenate on the result of that and finally a value mapper to the Notes field.
Instead of getting:
<root>
<itemNumber> 123 </itemNumber>
<Notes> 1,Active~2,Cancelled~3,Active </Notes>
</root>
I am getting:
<root>
<itemNumber> 123 </itemNumber>
<itemNumber> 123 </itemNumber>
<Notes> 1,Active~2,Cancelled~3,Active </Notes>
<Notes> 1,Active~2,Cancelled~3,Active </Notes>
</root>
Any ideas?
Thanks