Hello dear community
I have the following array
[
{
"Tracking Dimension": "NPD"
},
{
"Item Model Group": "NPD"
},
{
"Item Model Group": "NPD"
},
{
"Storage Dimension Group": "NPD"
},
{
"Reservation Hieararchy": "NPD"
},
{
"Product Coverage": ""
},
{
"Batch Number Group": "",
"End Of The Month": "No"
},
{
"Flushing Principle": "Manual"
},
{
"Commodity": ""
},
{
"Customer Hierarchy": ""
},
{
"Attributes": "None"
},
{
"Conversion EA to CS": "Not existing"
}
]
I would like to rework the array below in the following way.
[
{
"Tracking Dimension": "NPD",
"Item Model Group": "NPD",
"Item Model Group": "NPD",
"Storage Dimension Group": "NPD",
"Reservation Hieararchy": "NPD",
"Product Coverage": "",
"Batch Number Group": "",
"End Of The Month": "No",
"Flushing Principle": "Manual",
"Commodity": "",
"Customer Hierarchy": ""
"Attributes": "None",
"Conversion EA to CS": "Not existing"
}
]
How do I achieve this in PA?
It worked nicely.
Thank you very much
Hi @Anonymous ,
You can try this method:
Convert the data array into a text string, replace each occurence of the substring },{ with , (comma), then convert the result back into a (JSON) array:
json(replace(string(variables('varData')), '},{',','))
json(replace(string(variables('varData')), '},{',','))
Here is the sample runtime output:
[
{
"Tracking Dimension": "NPD",
"Item Model Group": "NPD",
"Storage Dimension Group": "NPD",
"Reservation Hieararchy": "NPD",
"Product Coverage": "",
"Batch Number Group": "",
"End Of The Month": "No",
"Flushing Principle": "Manual",
"Commodity": "",
"Customer Hierarchy": "",
"Attributes": "None",
"Conversion EA to CS": "Not existing"
}
]
Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.