Thank you everyone for your feedback – it got me pointed in the right direction to add a solution.
DV & Anton: I tried your API/Script suggestion and ran into a few issues. The GET /api/v2/analytics/conversations/{conversationId}/details API was returning an array of directions, and while I could load that into the script as a String, the script action would not let me select the variable for the logic test. I tried using originatingDirection instead, but it still showed outbound on transfers, and the inbound agent was still seeing the Outbound script.
Jose: in my initial testing, getting ScreenPopName was failing and showing as empty. So, I did not think this was a valid option. As I was testing my solution below, Get ScreenPopName suddenly started populating, so this could have been used, if I trusted it to be reliable.
Solution I ultimately settled on:
The suggestion of APIs got me thinking, and as I was working on another project, I had noticed that ScriptID was an attribute in some queries. So, using the API below, I created a simple Get ScriptID data action. For my uses I am not concerned with what script is assigned (or if there are multiple items in the array) – I just need to know if it is empty, and if so, assign something new.
/api/v2/conversations/calls/{conversationId}
{
"translationMap": {
"scriptId": "$.participants[*].attributes.scriptId"
},
"translationMapDefaults": {},
"successTemplate": "{\"Array1.scriptId\":${scriptId}}}"
}
------------------------------
Peter DeMarco
na
------------------------------
Original Message:
Sent: 04-24-2025 11:58
From: Jose Albor
Subject: Getting the assigned Screen Pop script
If one of your preceding flows contains an action to set a screen pop it automatically appends "scriptid" and "ScreenPopName" keys and values to the interaction-participant-data.
In each of your subsequent inbound or in-queue flows add a "Get Participant Data" action at the beginning of the flow and set (Attribute Name 1 = "ScreenPopName", Variable to assign 1 = Task.ScreenPopName). You can then evaluate IsNotSetOrEmpty(Task.ScreenPopName). If true, you can safely assume the script set in the queue configuration will be used. If false, you can evaluate with a decision expression if(Contains(Task.ScreenPopName, "DifferentScriptName")) or use an expression to check if Task.ScreenPopName matches a list of names FindFirst(MakeList("Name1", "Name2", "Name3", "Name4"), Task.ScreenPopName) >= 0. In the findfirst expression if 1 string is matched you'll have a result of 0, if 2 strings are matched you'll have a result of 1, if there are no matches you'll get a negative integer, hence why the expression contains a ">= 0" at the end of the expression to force it to go down the true path if one or more matches are found. Then you can set a different screen pop.
------------------------------
Carlos Albor
Principal PS Consultant
Original Message:
Sent: 04-22-2025 17:45
From: Peter DeMarco
Subject: Getting the assigned Screen Pop script
I'm looking for a method to confirm what, if any, Screen Pop script has been set in a call.
There does not appear to be a system variable in Architect that I can reference.
After using the Architect action Set Screen Pop, the participant data on the call shows an entry for ScreenPopName, but that does not appear to be written early enough to query (or can't be queried), as the Get Participant Data action is returning a variable that is Not Set/Empty.
Scenario:
We recently introduced a default Script and assigned it to our queues so it will display on agent initiated outbound calls. An unexpected side effect is that inbound calls into these queues are also displaying the default Script if they did not have another assigned in the flows - - and internal calls/transfers don't currently have a Screen Pop assigned, so they also display this default Script.
One solution for the internal calls is to set the Screen Pop in the In-queue Flow for the queue, but I don't want to accidentally override a previously set Screen Pop - hence my search for a method to confirm if one has already been set. While I could pair the Set Screen Pop action with a separate Set Participant Data action to write it myself, it would be cleaner if I had a way to query the system directly. Fewer updates needed across my flows.
I thought of another theoretical solution, but the Script environment doesn't appear to have a system variable that contains the direction of the call.
Any further insight into this puzzle would be appreciated.
#ArchitectureandDesign
------------------------------
Peter DeMarco
na
------------------------------