Inbound Chat script variable capture

I am using Pure Cloud Web Chat Widget 1.1 and sending the below mentioned information to the Pure Cloud " Inbound chat script" from Chat Wiget

{
firstName: 'John',
lastName: 'Doe',
customerId: '59606'
}

wanted to know , how can I capture the firstName coming from WebChat in Inbound Chat architect script on PureCloud , can you please confirm if "Chat.Guest.displayName" is the correct way to capture it in Architect chat script or I should use some other variable.

https://developer.mypurecloud.com/api/webchat/index.html

Hello,

No, it is not the right attribute name to capture firstName.

"Chat.Guest.customFields" is an array containing all submitted attributes. But as it is an array, you access elements via an index (integer) and not a key/name.

If you are trying to retrieve specific attributes, it is better and easier to use a "Get Participant Data" action in your Architect flow.
And use:
context.firstName to access your firstName
context.lastName to access your lastName
context.customerId to access your customerId
-> append "context." in front of the name you use on widgets/client side.

Regards,

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