Hi there, I am trying to check if json list has a node within.
in below json checking if IDOC.E1EDP01 has E1EDPT1; which works fine. then when I am trying to look for E1EDPT2, thats when its failing.
I have below expression.
$IDOC.E1EDP01.filter(x=>x.hasPath(‘E1EDPT1’)).length > 0 && jsonPath($, “IDOC.E1EDP01[*].E1EDPT1”).filter(x=>x.hasPath(‘E1EDPT2’)).length > 0
[
{
"IDOC": {
"E1EDP01": [
{
"POSEX": "00010",
"E1EDPT1": [
{
"E1EDPT2": [
{
"TDLINE": "CONTROL PANEL"
}
]
}
]
},
{
"POSEX": "00020",
"E1EDPT1": {
"E1EDPT2": [
{
"TDLINE": " TURBINE, DRAWING"
}
]
}
},
{
"POSEX": "00030",
"E1EDPT1": [
{
"E1EDPT2": [
{
"TDLINE": "CONTROLLER"
}
]
}
]
}
]
}
}
]
Any help in how I can achieve it?
Thanks
Manohar