I have following JSON, I need to get the personEmailContact which has a matching emailID with emailupdaterequest.emailContact. I tried to write the expression like $.responsebody[?(@.personEmailContact.emailId ==$.emailupdaterequest.emailContact.emailId)] but this does not seem to work, I need to write an expression which can work without substitution. Can anyone help with any pointers
{
"emailupdaterequest": {
"emailContact": {
"emailId": "admin@gmail.com",
"contactName": "ADMIN EMAIL"
}
},
"responsebody": [
{
"personEmailContact": {
"emailId": "admin@gmail.com",
"contactTypeCode": "P",
"contactName": "Joe"
}
},
{
"personEmailContact": {
"emailId": "nonadmin@gmail.com",
"contactTypeCode": "P",
"contactName": "john"
}
}
]
}