Ihor | 2024-04-11 00:37:52 UTC | #1
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": { "agentscount": "lenght($.entities[*].name)" }, "translationMapDefaults": { "agentscount": "0" }, "successTemplate": "{\n \"agentscount\": ${agentscount}\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?
Jerome.Saint-Marc | 2024-04-11 09:50:36 UTC | #2
Hello,
Something like this should work: "agents_count": "$.entities.size()"
Regards,
Ihor | 2024-04-11 17:33:46 UTC | #3
Thank you very much for your prompt response. It works!!!
system | 2024-05-12 17:34:33 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 25661