Filtering out an Array
Hello Experts,
I have input coming in as below:
[
{
"soap:Body": {
"@xmlns:soap": "http://www.w3.org/2003/05/soap-envelope",
"ns1:searchResponse": {
"@xmlns:ns1": "http://siemens.com/agilews",
"recordmap": {
"record": [
{
"field": [
{
"key": "T_FILE_DAT.FILE_TYPE",
"value": {
"@xmlns:ns3": "http://siemens.com/agilews",
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"@xsi:type": "ns3:StringValue",
"str": "ZIP"
}
},
{
"key": "T_FILE_DAT.C_ID",
"value": {
"@xmlns:ns3": "http://siemens.com/agilews",
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"@xsi:type": "ns3:StringValue",
"str": "123456"
}
}
]
},
{
"field": [
{
"key": "T_FILE_DAT.FILE_TYPE",
"value": {
"@xmlns:ns3": "http://siemens.com/agilews",
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"@xsi:type": "ns3:StringValue",
"str": "TIF"
}
},
{
"key": "T_FILE_DAT.C_ID",
"value": {
"@xmlns:ns3": "http://siemens.com/agilews",
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"@xsi:type": "ns3:StringValue",
"str": "6789087"
}
}
]
},
{
"field": [
{
"key": "T_FILE_DAT.FILE_TYPE",
"value": {
"@xmlns:ns3": "http://siemens.com/agilews",
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"@xsi:type": "ns3:StringValue",
"str": "PDF"
}
},
{
"key": "T_FILE_DAT.C_ID",
"value": {
"@xmlns:ns3": "http://siemens.com/agilews",
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"@xsi:type": "ns3:StringValue",
"str": "35462635"
}
}
]
}
]
}
}
}
}
]
The requirement is i need to pass only record containing T_FILE_DAT.FILE_TYPE.str = 'TIF'.
Also, the input from source sometimes comes out without being in an array. I want to create a solution which will work in both cases.
Thanks in Advance