AnsweredAssumed Answered

Merge JSON objects to single

Question asked by rkanaki on Sep 2, 2016
Latest reply on Sep 29, 2017 by rkanaki

Hello Team,

 

I was trying to generate a Json Object from EDI request received, while mapping the Request to Json Object it is generating multiple files based on the data.

 

.i.e. if there are 2 Lines in the Request then 2 Json object file would be generated

 

Current Object generated:

 

Json Obj1 : {

"source" : "ABC",
"ItemDetails" : [
{
"ItemName" : "item1",
"serialNumber" : "123445",
"quantitly" : "1"
}
]
}

Json Obj2 : {

"source" : "ABC",
"ItemDetails" : [
{
"ItemName" : "item2",
"serialNumber" : "127445",
"quantitly" : "1"
}
]
}

 

Need to generate the Object as

Json Obj1 : {

"source" : "ABC",
"ItemDetails" : [
{
"ItemName" : "item1",
"serialNumber" : "123445",
"quantitly" : "1"
},

{
"ItemName" : "item2",
"serialNumber" : "127445",
"quantitly" : "1"
}
]
}

 

Can you please guide on how to generate a single object.

 

Thank you.

Rakesh Kanaki

Outcomes