Using input from chatform in agent script

When a user initiate a chat from the website they fill out a some fields before being placed in queue.
Firstname
Lastname
E-mail
Phone number
All of this exept e-mail are predefined variables (firstName, lastName, phoneNumber).
https://developer.mypurecloud.com/api/webchat/

I'm trying to present them in a script for the agent.
Phone number: {{Chat.Customer Phone Number}}
Email: {{Email.Customer Email Address}} (This was just a test, in the code on front-end this field is defined as customField1)
Name: {{Chat.Customer First Name}}
{{Chat.Customer Last Name}}

But when we test this the only info that is presented for the agent is Name and Email.
The e-mail we know is wrong.
The others are blank.

Here is the script that is posted on the website, i tried to upload the file, but I get an error saying that new users can't upload files. i tried to anonymise it, thats why there are some xxxx here and there. https://pastebin.com/MmEKd9RD

Hope someone is able to help me, since we also try to use the input to search in their CRM solution.

I can see that the email provided on the web chat is sent to Purecloud, it shows up under interaction details when you are on the chat.


Does someone know the name of that variable and is it possible to display that in a script?

I've discussed this with the dev team and this feature isn't quite fully implemented. The issue to complete the work is CC-2858. Currently, the following properties are supported:

Scripter Variable Chat data variable
customerFirstName firstName
customerLastName lastName
customerStreet addressStreet
customerCity addressCity
customerPostalCode addressPostalCode
customerState addressState
customerPhoneNumber phoneNumber
customerPhoneType phoneType
customerId customerId

Additionally, the script will load additional participant attributes that match script variables. For example, you could create a script variable named customerAccountNumber and then set data.customerAccountNumber in your chat config, thereby allowing you to load any attributes you wish from the chat data into your script.

Yes, the phonenumber should work, but as you can see in my first post it does not.
Is there an error in my script? Why does it not show the phonenumer?

The email adress is already accessible since, it shows up under interactions detailes.
What is the name of that variable, so I can use that in the script and pass that information to the CRM?

The email variable is called email.

We got this working.
There was an issue with the frontend code.

As a workaround we used the lastName variable as the email, so er can use that in the script as well.

You can use any key as well, it doesn't have to be one of the named ones. You can use emailAddress1, emailAddress2, etc.

We're having the same problem with email address entered on a webform not coming into the interaction details (firstName and lastName are coming across fine). We are using email as the variable.

Here's the relevant section:
webchat.updateConfig({
"data": {
"firstName": data.firstName,
"lastName": data.lastName,
"email": data.email
}
})

Any thoughts on why the names are coming through but not the email address? Thanks.

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