I want to filter this array of object based on EmployeeStatus which should be only Resigned and Terminated but not active. Here the keys are different for each object and hence I am unable to apply logic like item.key.EmployeeStaus=="Resigned" or "Terminated"
.Any suggestions or hint would be helpful for me.
Input Payload
[
{
"626433000000196190": [
{
"EmailID": "[email protected]",
"Employeestatus": "Resigned"
}
]
},
{
"626433000000196184": [
{
"EmailID": "[email protected]",
"Employeestatus": "Active"
}
]
},
{
"626433000000196178": [
{
"EmailID": "[email protected]",
"Employeestatus": "Active"
}
]
},
{
"626433000000196166": [
{
"EmailID": "[email protected]",
"Employeestatus": "Terminated"
}
]
}
]
Required Output
[
{
"EmailID": "[email protected]",
"Employeestatus": "Resigned"
},
{
"EmailID": "[email protected]",
"Employeestatus": "Terminated
}
]
question from:https://stackoverflow.com/questions/65831199/unable-to-filter-array-of-objects-having-dynamic-keys-using-dataweave