Data action get count of agents in the queue

Hello!
I am trying to get a count of agents in the queue.

i am using the following API
/api/v2/routing/queues/${input.queue_id}/members/?skills=${skill1},${skill2}

In the response I am trying to get a lenght of the entities array

{
"translationMap": {
"agents_count": "lenght($.entities[*].name)"
},
"translationMapDefaults": {
"agents_count": "0"
},
"successTemplate": "{\n "agents_count": ${agents_count}\n}"
}

But it aways return default value 0

Does data action support jmespath length function?
How can i get a length of the entities array?

Hello,

Something like this should work:
"agents_count": "$.entities.size()"

Regards,

Thank you very much for your prompt response. It works!!!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.