Find a specific word in Json Object

In the router i am trying to route data based on below criteria

if any of the value in statusC.contains("T’) route to view1
if any of the value in !statusC.contains("T’). (does not contains) route to view2

How can i best achieve from below data

[
{
 "group" : [
{
"statusC":"T"
},
{
"statusC":"T"
}
 ]
},
{
 "group" : [
{
"statusC":"A"
},
{
"statusC":"A"
}
 ]
},
{
 "group" : [
{
"statusC":"T"
},
{
"statusC":"A"
}
 ]
},
{
 "group" : [
{
"statusC":"A"
},
{
"statusC":"T"
}
 ]
}
]

@npise use the expression - jsonPath($, “$group[?(@.statusC == ‘T’)]”).length > 0 : route to view1 else view2

Thanks for the response

I am using a router snap and i dont think i can use conditional.

@npise any expression enable snap you can use it.

Hi @npise,

I am sure that @Supratim was referring to output0 and output1 on the router, and not to a conditional operator. Configured router with his expression will do the job :

1 Like