Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Set Pre-Chat Form Fields to Automatically Populate when Customers Log In
The parameter you can use to set the fields that you want to pre-populate is included with your version 4.0 code snippet as a code comment.
embedded_svc.settings.prepopulatedPrechatFields = {...}
If you use Embedded Chat outside of Salesforce (with Lightning Out), you can set any pre-chat field to populate automatically using the fields’ API names. Find the field API names on the object pages for the objects you use with pre-chat. Then you can set the value of embedded_svc.settings.prepopulatedPrechatFields with a JavaScript object that contains the customer’s information.
1embedded_svc.settings.prepopulatedPrechatFields = {
2 FirstName: “John”,
3 LastName: “Doe”,
4 Email: “john.doe@salesforce.com”,
5 Subject: “Hello”
6};