Go to All Forums

Json Path Expression

Hello, I have the following json expression to identify the count value, with this example if it works

Correct:     $.results[0].data[0].metrics[0].stats.count

but my intention is to indicate that when "count" is equal to zero then an alert is triggered, could you please help me complete the expression.

Incorrect:   $.[?(results[0].data[0].metrics[0].stats.count == 0)]


Xpath Evaluator:

{{ "results": [{ "group": { "flowId": "48e98a54-f345-4101-aab9-eb886deac9ea", "mediaType": "voice" }, "data": [{ "interval": "2023-05-17T00:00:00.000-06:00/2023-05-17T23:59:59.599-06:00", "metrics": [{ "metric": "nFlow", "stats": { "count": 35954 } }] }] }]}

Like (2) Reply
Replies (2)

Hi Higareda,
Please use this expression as it will alert whenever the status count goes Zero.

$.results[0].data[0].metrics[0].stats[?(@.count > 0)]


Like (0) Reply

Thanks for the support. 

Like (0) Reply

Was this post helpful?