@manohar,
I don’t believe the “in” operator will do a deep object search without some creative expression coding.
.
There are probably a dozen ways to accomplish what you want, but based on the object structure you provided, here are optional expressions for your router.
-
'E1EDPT2' in $.IDOC.E1EDP01[0].E1EDPT1
note: this expects only 1 item in the E1EDP01 array, so probably won’t work for you if there’s a potential for multiple items - but I’m providing it so you see the “in” operator works in the specific object path.
jsonPath($,"$.IDOC.E1EDP01[?('E1EDPT2' in @.E1EDPT1)]").length > 0
-
jsonPath($,"$.IDOC.E1EDP01[?(@.E1EDPT1.hasPath('E1EDPT2'))]").length > 0
note: 2 & 3 are very similar, but with different jsonPath filter options.
There are likely a number of other options that may be better suited depending on your overall input payload size and structure and potential overhead of the expression. But, hopefully these options will give you ideas to help you on your search.
Also, you probably want to select the “First match” checkbox in the router, otherwise, the documents will flow through to both outputs.