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
------------------------------