• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Blog
  • Power Platform
    • Power Apps
    • Power Automate
    • Power BI
    • Power Virtual Agents
  • Dynamics 365
  • Azure
  • About Me
Joe Gill Logo

Joe Gill

Microsoft MVP - Power Platform Consultant

Home » Power Platform » Dynamics 365 » Hand off a Virtual Agent Bot to a Omnichannel Chat

Hand off a Virtual Agent Bot to a Omnichannel Chat

12th August 2019 by Joe Gill

I could not find any information on how to to hand off a Virtual Agent Bot to a live agent so I thought I would have a go at doing this. I previously did a post how to deploy a virtual agent bot to a CDS Portal here. I am going to modify this bot to allow the user to transition the conversation to a human agent. The results are not as seamless as I would have liked however I think this is acceptable considering we are working in a no code environment.

Hand off a Virtual Agent Bot to a Omnichannel Chat Joe Gill Dynamics 365 Consultant

There are three steps required to accomplish this

  1. Create an Omnichannel Chat Channel to accept the transferred bot conversations
  2. Create a page in the Portal to host the Omnichannel chat widget.
  3. Add the chat page url to the Virtual Agent Topic so the user the can transfer to an agent

Step 1: Creating dynamics 365 Omni channel

In the Omnichannel Administration App I created a chat widget called Bot Transfer to handle transfers from the Virtual Agent Bot. Saving the chat widget generates the Javascript code required to start a chat session. We will use that later to initiate the chat transfer.

Hand off a Virtual Agent Bot to a Omnichannel Chat Joe Gill Dynamics 365 Consultant

Step 3: Create a page in the Portal to host the Omnichannel chat widget.

From the CDS Web Portal App I created a Web File called chat.html which is the page that will host the Omnichannel chat widget

Hand off a Virtual Agent Bot to a Omnichannel Chat Joe Gill Dynamics 365 Consultant

I needed to add the Omnichannel chat snippet as an note attachment to this chat page file. The out of the box chat snippet prompts the user to click a button to start the chat. To avoid this I modified the snippet to start immediately by added in data-hide-chat-button=”true” and the Javascript below it to to start the chat immediately.

<script id="Microsoft_Omnichannel_LCWidget" src="https://oc-cdn-public-eur.azureedge.net/livechatwidget/scripts/LiveChatBootstrapper.js" 
        data-app-id="e1de728f-c4c5-4397-b4b5-048edb8bf528" data-org-id="98315898-538e-4c55-93cf-b28f0afb1ee7" 
        data-org-url="https://org1fbee8a1-crm4.omnichannelengagementhub.com" 
        data-hide-chat-button="true">
window.addEventListener("lcw:ready", function handleLivechatReadyEvent(){
	Microsoft.Omnichannel.LiveChatWidget.SDK.startChat();
});
</script>

Step 3: Add chat page URL to Virtual Agent Topic

The final step is to edit your Bot’s topic to hand off to a live agent in Omnichannel. I edited the Escalate system topic and added a hyperlink to the CDS Portal page chat.html as shown.

Hand off a Virtual Agent Bot to a Omnichannel Chat Joe Gill Dynamics 365 Consultant

Now if the Bot users triggers the escalate Topic they are prompted with a link they can click to start a session with a live agent. This will open up the chat page and the chat will immediately start.

Ideally it would be great if the hand over to the agent was in the same chat window. I can’t imagine that is possible are they are both hosted separately. I saw a Microsoft video somewhere that said the bot conversation history would be available to the chat agent when it gets handed off but I could not find a way to do it.There is a way to pass context data from the virtual bot to the Omnichannel but I have not tried tried that yet.

Share This On Social:
  • Tweet
  • Hand off a Virtual Agent Bot to a Omnichannel Chat Joe Gill Dynamics 365 Consultant

Filed Under: AI, Dynamics 365, Power Virtual Agents

Primary Sidebar

Popular Categories

  • Power Platform
    • Power Apps
    • Power Automate
    • Power Virtual Agents
  • Azure
    • Logic Apps
  • Dynamics 365
  • .NET
  • AI
  • SQL

More to See

Power Platform Requests – Base Request Capacity

17th December 2020 By Joe Gill

Power Automate Desktop

Power Automate Desktop – UI Flow

26th November 2020 By Joe Gill

Tweets

Footer

Joe Gill

Microsoft Business Applications MVP – Power Platform, Dynamics 365 and Azure.

An architect with over twenty years experience designing and developing technology solutions. Specializing in the Microsoft technology stack including Power Platform, Dynamics 365 and Azure. Microsoft MVP Profile

Connect on Social

Useful Links

  • Home
  • Blog
  • About Joe Gill
  • Power Platform
  • Dynamics 365
  • Azure

Featured Posts

Power Platform Requests – Base Request Capacity

Power Automate Desktop – UI Flow

MB-600 – Solution Architect – Supportability

AI Builder – Form Processing Layouts

© 2021 · Joe Gill