3

I have a contact JSON object like this:

{ "contactType": "Manager", "firstName": "Tom", "lastName": "Jones" }

I am trying to query the object like:

(contactType=='Manager')

to check if the contactType is indeed Manager. My question is if the expression is true, how can I return the value, something like firstName, from the confirmed Manager object? I know this is easily done with arrays by piping, such as if I had multiple contacts and used:

([?contactType=='Manager']|[0].firstName) 

but how can I achieve the same result checking a singular JSON in a single expression?

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
mortimerfreeze
  • 199
  • 1
  • 1
  • 9

0 Answers0