Hello,
We have two types of queues: "front" queues for the inbound flows transfer and "back" queues for agents transfer. The "front" queue names ends with postfix "_front" and "back" queue names with postfix "_back", for example, "new_customers_front".
I need to receive all "front" queues that a given agent belongs to.
I can receive all queues that a given agent belongs to using GC API :
GET /api/v2/users/${input.AGENT_ID}/queues?joined=true
but I can't figure out how to define filter in the response translation map to receive "front" queues only. Is it possible to use regexp or java string functions in the translation map?
Or this task can be only implemented in Architect flow that calls the data action?
This is my Response Configuration.
The JSONPath expression will only match values ending with _front (case sensitive).
I noticed something which I didn't have time to investigate. If there are no queues with a name ending with _front, when I test my Data Action, it returns the following array: [ null ]
I haven't checked how that is then available in Architect - an array with a value (and the value IsNotSet) or an array with no value.
Thank you, Jerome!
The comparator =~ is exactly what I need. Is it a new feature? I haven't found any information about it in the Velocity macros for DA documentation.
One more question, can "front" be input parameter for DA in this expression:
The Data Action can leverage 2 things - a set of Velocity macros and JSONPath expressions (in the response configuration).
See Response configuration for data actions
JSONPath is what provides the way to parse the JSON response to select one or more attribute values (HTTP Body response).
You can see what's possible in terms of JSONPath operators here. I don't know if all of the functions in this page are supported (there are different versions of JSONPath with few variations - specifically on functions).
Unfortunately, it is not possible to leverage an input parameter (from the Input Contract) in a Response Configuration.
But you could possibly extract both with the same Data Action and decide in your Architect Flow if you are to use Front or Back Queues.