AnsweredAssumed Answered

Filter the Child records in XML

Question asked by aishwarya.jayapal756738 on Jun 13, 2018
Latest reply on Jun 13, 2018 by aishwarya.jayapal756738

Hello All,

 

I have a requirement where i have the XML file as source which contains header<ItemHdrDesc> information and detail information<Itemdetail> which is unbounded and can be repeated 'n' number of times.

 

I need to send all the header information and only specific detail information based on one indicator in detail element.

 

My source is,

 

<ns91:ItemDesc >
<ItemHdrDesc>
<item>103638243</item>
<item_number_type>ITEM</item_number_type>
<tran_level>1</tran_level>
</ItemHdrDesc>
<ns15:ItemDetail>
<ns15:item>103638243</ns15:item>
<ns15:supplier>12222</ns15:supplier>
<ns15:primary_detail_ind>Y</ns15:primary_detail_ind>
<ns15:unit_cost>0.01</ns15:unit_cost>
</ns15:ItemDetail>
<ns15:ItemDetail>
<ns15:item>103638243</ns15:item>
<ns15:supplier>123</ns15:supplier>
<ns15:primary_detail_ind>N</ns15:primary_detail_ind>
<ns15:unit_cost>0.03</ns15:unit_cost>
</ns15:ItemDetail>
</ns91:ItemDesc>

 

from the above XML i need to map all the header attributes to the target and only one detail attributes which has primary_detail_ind ='Y' and other detail records are not required.

 

My sample output is,

 

<ItemInfo>
<item>103638243</item>
<item_number_type>ITEM</item_number_type>
<tran_level>1</tran_level>
<supplier>12222</supplier>
<primary_detail_ind>Y</primary_detail_ind>
<unit_cost>0.01</unit_cost>
</ItemInfo>

 

Can any one suggest how to achieve this in boomi using mapping or any other shapes.

Outcomes