I need to loop over the below Json array and transform the data into the expected output. However, I am facing problem in looping over the nested array.
input :
[{"DomainName":"Access Supplier",
"Data_Category" :
[{"Data_Category_Name":"System","Data_Category_AssetID":"2"}],
"Data_Fields":
[{"Field_Name":"First Name","WID":"7a"},
{"Field_Name":"Last Name","WID":"213"}]},
{"DomainName":"Access Talent",
"Data_Category":
[{"Data_Category_Name":"Talent culture","Data_Category_AssetID":"54c"}],
"Data_Fields":
[{"Field_Name":"Key Resp","WID":"de7"},
{"Field_Name":"Talent","WID":"043b5"}]}]
Expected Output:
[{
"Field_Name": "First Name"
"Data_Category": [
{
"Data_Category_AssetID": "2"
"Data_Category_Name": "System"
}
],
"Field_Name":"Last Name"
"Data_Category": [
{
"Data_Category_AssetID": "2"
"Data_Category_Name": "System"
}],
"Field_Name":"Key Resp"
"Data_Category": [
{
"Data_Category_AssetID": "54c"
"Data_Category_Name": "Talent culture"
}],
"Field_Name":"Talent"
"Data_Category": [
{
"Data_Category_AssetID": "54c"
"Data_Category_Name": "Talent culture"
}]
} ]