# XML map connector - implode/join

**URL:** <https://community.cdata.com/t/xml-map-connector-implode-join/1191>\
**Category:** CData Arc\
**Tags:** question, xml-mapping, implode, edi\
**Created:** [September 18, 2025, 10:11am UTC](https://community.cdata.com/t/xml-map-connector-implode-join/1191 "2025-09-18T10:11:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IT\_Gheys](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/it_gheys/32/1332_2.png) [@IT\_Gheys](https://community.cdata.com/u/IT_Gheys)\
**Post date:** [September 18, 2025, 10:12am UTC](https://community.cdata.com/t/xml-map-connector-implode-join/1191/1 "2025-09-18T10:12:59Z")

</div>

We are trying the map multiple fields in a XML (EDI)&nbsp;into one field in another XML in a XML Map connector. We use the implode formatter for this. But it isn’t working, we only get the first item. But we want all the&nbsp;NTE02 fields joined with a newline as separator.

This is the script we use:

[xpath(“FunctionalGroup/TransactionSet/TX-00401-940/NTE/NTE02”) | implode]

Source XML:

\<FunctionalGroup\>

\<TransactionSet\>

\<TX-00401-940 type=“TransactionSet”\>

\<NTE type=“Segment”\>

\<!--Note

Reference Code--\>

\<NTE01\>\<!--Warehouse

Instruction--\>WHI\</NTE01\>

\<!--Description--\>

\<NTE02\>PALLETS COVERED WITH STRETCH HOOD\</NTE02\>

\</NTE\>

\<!--Note/Special

Instruction--\>

\<NTE type=“Segment”\>

\<!--Note

Reference Code--\>

\<NTE01\>\<!--Warehouse

Instruction--\>WHI\</NTE01\>

\<!--Description--\>

\<NTE02\>ONLY CP7 PALLETS\</NTE02\>

\</NTE\>

\<!--Note/Special

Instruction--\>

\<NTE type=“Segment”\>

\<!--Note

Reference Code--\>

\<NTE01\>\<!--Warehouse

Instruction--\>WHI\</NTE01\>

\<!--Description--\>

\<NTE02\>PLEASE LOAD MAX 2 BATCHES\</NTE02\>

\</NTE\>

\</TX-00401-940\>

\</TransactionSet\>

\</FunctionalGroup\>

Destination XML:

\<Remarks\>PALLETS COVERED WITH STRETCH HOOD\</Remarks\>

---

<div class="post-metadata">

**Author:** ![Chaitanya\_Sandra](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/chaitanya_sandra/32/989_2.png) [@Chaitanya\_Sandra](https://community.cdata.com/u/Chaitanya_Sandra)\
**Post date:** [September 19, 2025, 6:16am UTC](https://community.cdata.com/t/xml-map-connector-implode-join/1191/2 "2025-09-19T06:16:40Z")

</div>

Hi Gheys,

_This is the script we use:_

_[xpath(“FunctionalGroup/TransactionSet/TX-00401-940/NTE/NTE02”) | implode]_

Your requirement is to store each NTE02 field value for each&nbsp;mapping iterations within the XML map with comma ”,”&nbsp;separated. To do this you will require to create an array variable, let me explain this step by step.

Below are the samples I’m using your sample as a Source and below one as Destination within the XML map:

Destination xml file:

\<Target\>  
\<Remarks\>PALLETS COVERED WITH STRETCH HOOD\</Remarks\>  
\</Target\>

1. Create a&nbsp;[Virtual Loop](https://cdn.cdata.com/help/AZJ/mft/XML-Map-Virtual-Nodes.html#loop)&nbsp;over the NTE Segment (as you want to loop over all NTE segments for all NTE02 fields) .  
2. Add a child Variable&nbsp;and name the variable(I provided **NTE02Data#** as a variable name) and map the NT02 Field to this Variable.

 ![e501b189-013e-4620-ac42-7aa0abc907e5.png](https://us1.discourse-cdn.com/cdata/original/2X/2/20efde1a241aa848829bb11c38d950f85c1d4581.png)

1. Add Remarks Field as a sibling field to the Virtual loop

2. 

[XMLMap-Implode.zip](https://community.cdata.com/uploads/short-url/d3KMx378clfjsbFR0t9ie4ufAML.zip) (3.6 KB)

---

<div class="post-metadata">

**Author:** ![IT\_Gheys](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/it_gheys/32/1332_2.png) [@IT\_Gheys](https://community.cdata.com/u/IT_Gheys)\
**Post date:** [September 19, 2025, 7:05am UTC](https://community.cdata.com/t/xml-map-connector-implode-join/1191/3 "2025-09-19T07:05:52Z")

</div>

Thank you, it works!
