You need to sign in to do that
Don't have an account?

Setting Pre-Chat Form Fields to Automatically Populate for logged in users
I am working on deploying Snap-Ins chat to our website, including within our web-app and I want to be able to pass values from our logged in users into pre-chat fields in Live Agent. I found this documentation and pasted the code from the article in as a test in our sandbox, but when I do that the chat button goes away, so I can't even get to the pre-chat form.
Help article: https://developer.salesforce.com/docs/atlas.en-us.snapins_web_dev.meta/snapins_web_dev/snapins_web_populate_prechat.htm
All I'm doing is going to the chat button code, un-commenting the embedded_svc.settings.prepopulatedPrechatFields" line, and pasting in the following below it:
embedded_svc.settings.prepopulatedPrechatFields = {
FirstName: “John”,
LastName: “Doe”,
Email: “john.doe@salesforce.com”,
Subject: “Hello” };
Any help is much appreciated.
Help article: https://developer.salesforce.com/docs/atlas.en-us.snapins_web_dev.meta/snapins_web_dev/snapins_web_populate_prechat.htm
All I'm doing is going to the chat button code, un-commenting the embedded_svc.settings.prepopulatedPrechatFields" line, and pasting in the following below it:
embedded_svc.settings.prepopulatedPrechatFields = {
FirstName: “John”,
LastName: “Doe”,
Email: “john.doe@salesforce.com”,
Subject: “Hello” };
Any help is much appreciated.
The reason is pure syntax issue. Please replace double quotes with single quotes. Let me know if you face any issues.
embedded_svc.settings.prepopulatedPrechatFields = {
FirstName: 'John',
LastName: 'Doe',
Email: 'john.doe@salesforce.com',
Subject: 'Hello'};
Thanks,
Sandeep