Salesforce Service Cloud: Integrate Live Chat Handover

salesforce-service-cloud.png

Source: https://www.salesforce.com/products/service-cloud/overview/

The Salesforce Service Cloud enables the forwarding of a chat conversation to a Salesforce service agent in order to provide detailed expertise information to the user. This tutorial will explain how to integrate an organization's Salesforce instance to a Cognigy.AI virtual agent and finally hand over a bot conversation to the Salesforce Agent Chat.

   Watch Cognigy Showcase "Customer Service with Salesforce Live Agent handover"


Table of Contents

  1. Demo
  2. Setup a Salesforce Chat Agent
  3. Configure the Salesforce Handover Settings
  4. Handover the conversation
  5. Optional: Send details from Cognigy.AI to Salesforce Service Cloud

Demo

With Cognigy.AI version 4.16.0, the Salesforce Service Cloud handover is provided natively within the Endpoint configuration. Watch the following to learn how it works:

 

Setup a Salesforce Chat Agent

If the Service Cloud is already in use, the required information might be available. Please check if the following credentials are provided in the Salesforce instance:

Salesforce ...

If it is the case, that no Chat Deployment is available in Salesforce at the moment, please follow these guides:

Finally, one will find a created Chat Deployment in the Salesforce Setup, such as:

salesforce-service-cloud-chat-deployments.PNG

The information/credentials that are required for the next step can be found in the detailed view of the new Chat Deployment (in this case "First Agent"):

salesforce-service-cloud-chat-deployment-details.PNG

In the above figure, this information is hidden. However, one can extract the Deployment ID, Organization ID, and Live Agent URL from the HTML code that can be found in the Deployment Code section:

liveagent.init('Live Agent URL', 'Deployment ID', 'Organization ID');

The missing Live Chat Button ID can be found in the Setup as well:

salesforce-service-cloud-livechat-buttons.PNG

By clicking on the created button and then scrolling down to the bottom, similar HTML information such as the Chat Deployment's one can be found:

salesforce-service-cloud-livechat-button-details.PNG

While the sensitive information is hidden again, the Live Chat Button ID can be extracted:

liveagent.showWhenOffline('Live Chat Button ID', document.getElementById('liveagent_button_offline_...h'));

Configure the Salesforce Handover Settings

Since the previous chapter discussed how to set up the Salesforce side, one can now continue editing the Cognigy.AI virtual agent. In this step, the Endpoint will be configured. In this example, the Webchat is used. In order to do so, navigate to Deploy -> Endpoints -> Webchat. Afterward, scroll down to the section called "Handover Settings":

cognigy-endpoint-salesforce-handover-settings-example.png

The above fields show exmpale values while they need to be filled with the Salesforce Chat Deployment information. 

Handover the conversation

From now on, it is possible to create a conversational integration with Salesforce and thus let the dialog expand its capabilities. As soon as the user has the intention to talk to a human, the "Handover to Agent" Flow Node should be executed.

cognigy-flow-handover-to-agent-node-exmaple-salesforce-service-cloud.png

As soon as this Node is executed and an agent is available inside of the Salesforce Service Cloud, the Salesforce agent will see the following (example) in their Omnichannel window:

salesforce-service-cloud-incoming-request-example.PNG

In order to start the conversation, the Salesforce agent has to accept the incoming request and send a message to the user.

Optional: Send details from Cognigy.AI to Salesforce Service Cloud

Next to the normal process of forwarding a conversatoin from the virtual to the human agent, more detailed information might be of interest, too. For example, the user could be an existing "Contact" that should be displayed to the Salesforce agent for a better service. For this scenario, the "Handover To Agent" Flow Node contains a "Salesforce Settings" section consisting of two JSON fields:

  1. Prechat Entities
    1. What Salesforce Entities (Contact, Account, Case, etc.) should be prefilled
  2. Prechat Details
    1. The actual content that should be filled in for the Entities

cognigy-ai-salesforce-settings-handover-to-agent-node.png

Attention

Please make sure that both, the Prechat Entities AND Prechat Details are filled with valid content. Otherwise, it will not work!

Prechat Details:

This could contain any kind of information that was collected during the bot conversation, such as context variables:

[
	{
		"label": "Cognigy",
		"value": "Infos from chat: {{context.key}}",
		"transcriptFields": [
			"Body"
		],
		"displayToAgent": true
	}
]

or

[
       {
         "label":"LastName",
         "value":"Mustermann",
         "entityMaps":[
            {
               "entityName":"contact",
               "fieldName":"LastName"
            }
         ],
         "transcriptFields":[
            "LastName__c"
         ],
         "displayToAgent":true
      },
      {
         "label":"FirstName",
         "value":"Max",
         "entityMaps":[
            {
               "entityName":"contact",
               "fieldName":"FirstName"
            }
         ],
         "transcriptFields":[
            "FirstName__c"
         ],
         "displayToAgent":true
      },
      {
         "label":"Email",
         "value":"max.mustermann@mail.de",
         "entityMaps":[
            {
               "entityName":"contact",
               "fieldName":"Email"
            }
         ],
         "transcriptFields":[
            "Email__c"
         ],
         "displayToAgent":true
      },
      {
         "label":"Status",
         "value":"New",
         "entityMaps":[
            {
               "entityName":"Case",
               "fieldName":"Status"
            }
         ],
         "transcriptFields":[
            "caseStatus__c"
         ],
         "displayToAgent":true
      },
      {
         "label":"Origin",
         "value":"Web",
         "entityMaps":[
            {
               "entityName":"Case",
               "fieldName":"Origin"
            }
         ],
         "transcriptFields":[
            "caseOrigin__c"
         ],
         "displayToAgent":true
      },

      {
         "label":"Subject",
         "value":"TestCaseSubject",
         "entityMaps":[
            {
               "entityName":"Case",
               "fieldName":"Subject"
            }
         ],
         "transcriptFields":[
            "subject__c"
         ],
         "displayToAgent":true
      },
      {
         "label":"Description",
         "value":"TestCaseDescriptionShr",
         "entityMaps":[
            {
               "entityName":"Case",
               "fieldName":"Description"
            }
         ],
         "transcriptFields":[
            "description__c"
         ],
         "displayToAgent":true
      }
   ]

The above JSON information is displayed as Details in the Salesforce Service Console.

Prechat Entities:

If one wants to connect the bot user with a Salesforce Entity (e.g. Contact), so-called Prechat Entites could be sent to the live chat session:

[
   {
         "entityName":"Contact",         
         "saveToTranscript": "Contact",
         "linkToEntityName":"Case",
         "linkToEntityField":"ContactId",
         "showOnCreate":true,          
         "entityFieldsMaps":[
             {
               "fieldName":"LastName",
               "label":"LastName",
               "doFind":true,
               "isExactMatch":true,
               "doCreate":true
            },
            {
               "fieldName":"FirstName",
               "label":"FirstName",
               "doFind":true,
               "isExactMatch":true,
               "doCreate":true
            },
            {
               "fieldName":"Email",
               "label":"Email",
               "doFind":true,
               "isExactMatch":true,
               "doCreate":true
            }          
         ]
      },
       {
         "entityName":"Case",
         "showOnCreate":true,          
         "saveToTranscript":"Case",
         "entityFieldsMaps":[
            {
               "fieldName":"Status",
               "label":"Status",
               "doFind":false,
               "isExactMatch":false,
               "doCreate":true
            },
            {
               "fieldName":"Origin",
               "label":"Origin",
               "doFind":false,
               "isExactMatch":false,
               "doCreate":true
            },  

         {
               "fieldName":"Subject",
               "label":"Subject",
               "doFind":false,
               "isExactMatch":false,
               "doCreate":true
            },
            {
               "fieldName":"Description",
               "label":"Description",
               "doFind":false,
               "isExactMatch":false,
               "doCreate":true
            }         
         ]             
        
      }      
      
   ]

Comments

0 comments

Article is closed for comments.

Was this article helpful?
1 out of 1 found this helpful