Greet Customers without Pre-Chat Form in Salesforce Chat

Greet Customers without Pre-Chat Form in Salesforce Chat

If you are going to use Experience Cloud Site, then use the following link.

We can use Einstein BOT Context Variable to greet Customers without Pre-Chat Form in Salesforce Chat. 

1. Create a Custom field in Chat Transcript object. This field will be used to store First Name of the customer who initiated the chat.

2. Create a Context Variable in your Einstein Bot.

<contextVariables>
    <contextVariableMappings>
        <SObjectType>LiveChatTranscript</SObjectType>
        <fieldName>LiveChatTranscript.First_Name__c</fieldName>
        <messageType>WebChat</messageType>
    </contextVariableMappings>
    <dataType>Text</dataType>
    <developerName>TranscriptFirstName</developerName>
    <label>Transcript First Name</label>
</contextVariables>

3. Update Waiting Message using Additional branding in the Embedded Service Deployment Chat Settings.

4. Add the following code in your Embedded Service Deployment Code Snippet. This will store the first name of the customer in the First Name custom field in the Chat Transcript. Also, this value will be available in TranscriptFirstName Einstein BOT Context Variable.

embedded_svc.settings.extraPrechatFormDetails = [ 
    {
        "label": "First Name",
        "value": "Test First Name",
        "displayToAgent": true, 
        "transcriptFields": ["First_Name__c"]
    }
];

5. Use Rule Action to set TranscriptFirstName Einstein BOT Context Variable to a custom variable “FirstName” in the Einstein BOT Welcome Dialog. Then, use the Context Variable to greet the customer.

Output:

Leave a Reply