Skip to content

Loop through the array and add two different properties into one array #264

@venkat352

Description

@venkat352

Hi, I have been struggling to get the below scenario. Can someone please help me to get the below?

{
"Customer":[
{
"Info1":{
"Field1":"Value1",
"Field2":"Value2",
"Field3":"Value3"
},
"Info2":{
"Field4":"Value4",
"Field5":"Value5",
"Field6":"Value6"
}
},
{
"Info1":{
"Field1":"Value7",
"Field2":"Value8",
"Field3":"Value9"
},
"Info2":{
"Field4":"Value10",
"Field5":"Value11",
"Field6":"Value12"
}
}
]
}

Expected output

{
"GenericCustomer":[
{
"GenericComponent1":"Value1",
"GenericComponent2":"Value2",
"GenericComponent3":"Value3"
},
{
"GenericComponent1":"Value4",
"GenericComponent2":"Value5",
"GenericComponent3":"Value6"
},
{
"GenericComponent1":"Value7",
"GenericComponent2":"Value8",
"GenericComponent3":"Value9"
},
{
"GenericComponent1":"Value10",
"GenericComponent2":"Value11",
"GenericComponent3":"Value12"
}
]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions