AnsweredAssumed Answered

Json repeating array to single xml field

Question asked by vishal.doijode on Jun 28, 2018
Latest reply on Jun 28, 2018 by Adam Arrowsmith

Hello 

I have json structure as below and I need to concatenate "street" (repeating array) field values in to single string field in xml structure.

 
Input 

"billing_address" : {
"region_id" : 12,
"street" : [
"1444 S",
"Alameda Street"
],
"telephone" : "111111111111"
},

 

Expected Output :

<billing_address>

<region_id>12</region_id>

<address>1444 S Alameda Street</address>

<telephone>111111111111</telephone>

</billing_address>


I tried using javascript to concate these values but it doesn't work, I get two records after map shape for each  "1444 S" and "Alameda Street".

 

Two records

<billing_address>

<region_id>12</region_id>

<address>1444 S</address>

<telephone>111111111111</telephone>

</billing_address>

 

<billing_address>

<region_id>12</region_id>

<address>Alameda Street</address>

<telephone>111111111111</telephone>

</billing_address>

 

 

Thanks in advance

Outcomes