How to pass value of variables in Script to Participant data in Call Flow

Hi all,

I have a question regarding a value of variables in Script to be retrieved as Participant data in the Call Flow

For example, I want the Scripter.Agent Name value to be passed to the Call Flow Participant data in order to retrieve it at the last of the call (through API "get call conversation")

I mean that we want to configure input/ouput variable in Script with name like for example: agentFullName

Then, we have to retrieve the name of the agent in the Architect as attributes, once the call finished, see the example below:

attributes":{
"agentFullName":"Jean Dupon",
"conversationType":"C",
"Contact":"MOSTAFA",
"objectCall":"TEST",
"scriptId":"bb6c06d3-2523-466c-bd7e-a7db7210f160",
"event":"Incoming",
"date":"2019-12-09T11:48:57.000Z",
"Num_ANI":"0123456789",
"ScreenPopName":"TEST"

Please, do you know how I can do this ?

Thank you in advance.

Output variables get written to participant attributes. https://help.mypurecloud.com/articles/script-input-output-variables/

The Output property makes it possible to store the value of a script variable for use after a call ends, without having to set up a data action, or add supplemental columns to a contact list. When Output is set to Yes, the value of this script variable is written to the conversation object. Its saved value may be programmatically retrieved by a customer’s external process. To use a variable as an output variable, enable Output . When the value of this variable changes during execution of a script, the conversation object is updated in 3 seconds.

1 Like

Hi Tim, thanks for your reply

My next question is, in which part of the conversation (If get conversation per ID through API) I can find the values of the ouptut variables configured on the Script ?

Thank you in advance

They're participant attributes on the conversation.

Thank you Tim, yes, I can found the attributes but how to fill the variable automatically without be entered by the agent, for example for Agent Name, how to enter agent name automatically and retrieve it in attributes at the end of the conversation ?

Thank you.

You can use the Set Variable action to set the variable so it will be written to the participant attributes. How you trigger this action is up to you depending on how you want it to behave.

Thank you Tim, I see now how to create custom data action with "Set variable" step
Now, what I need only how to trigger this automatically in a field within the Script

Thank you.

You can trigger actions on page load, button press, or input value changed.

Hi Tim, great!!
It works fine...thank you

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