I have below payload with a hierarchy and trying to filter based on the columnn "DeleteIndicator" = "Y". These are the fixed columns I will be getting. I want to traverse through the payload and check for the DeleteIndicator. Updated the input and expected output for multiple child in inner array.
Input:
{
"Num":4363886,
"LineItems":[
{
"DetailGUID":"B439E023360C",
"DeleteIndicator":"Y"
},
{
"DetailGUID":"B439E023360C",
"LineQuantity":[
{
"AltGUID":"2B43AC4203DC",
"DeleteIndicator":"Y"
},
{
"AltGUID":"2B43AC4203DD",
"DeleteIndicator":"Y"
}
]
},
{
"DetailGUID":"B439E023360C",
"LineQuantity":[
{
"AltGUID":"2B43AC4203DC",
"ShipTo":[
{
"ShipToGUID":"2B43AC4201AB",
"DeleteIndicator":"Y"
},
{
"ShipToGUID":"2B43AC4201AC",
"DeleteIndicator":"Y"
}
]
}
]
}
]
}
Expected Output:
{
"Num":4363886,
"Details":[
{
"DetailGUID":"B439E023360C",
"AltGUID":null,
"ShipToGUID":null
},
{
"DetailGUID":"B439E023360C",
"AltGUID":"2B43AC4203DC",
"ShipToGUID":null
},
{
"DetailGUID":"B439E023360C",
"AltGUID":"2B43AC4203DD",
"ShipToGUID":null
},
{
"DetailGUID":"B439E023360C",
"AltGUID":"2B43AC4203DC",
"ShipToGUID":"2B43AC4201AB"
},
{
"DetailGUID":"B439E023360C",
"AltGUID":"2B43AC4203DC",
"ShipToGUID":"2B43AC4201AC"
}
]
}