Automating Customer Service in Dynamics 365 with Power Virtual Agents: Part 1 - Text Chat

Written by thecognitiveservicesninja | Published 2023/04/20
Tech Story Tags: dynamics-365 | microsoft-dynamics | virtual-assistant | customer-service | customer-experience | customer-engagement | business-strategy | optimization | web-monetization

TLDRThis article is the first part of a Kickstarter of two pieces. In this article and in the second part, I will focus on Power Virtual Agent in combination with Dynamics 365 Customer Service. The first article focuses on a text chat virtual agent with a handover option to a human agent, aka live chat. The second will demonstrate how to voice enable D365 and use voice bots.via the TL;DR App

Integrating human and non-human agent support for your customer

This article is the first part of a Kickstarter of two pieces; in this article and in the second part, I will focus on Power Virtual Agent in combination with Dynamics 365 Customer Service. The first article focuses on a text chat virtual agent with a handover option to a human agent, aka live chat. The second will demonstrate how to voice enable D365 and use voice bots. Both pieces will demonstrate that it is possible to provide Omnichannel Customer service with human and non-human agents without a classical Contact Center installation.

Imagine a situation where your virtual agent is incapable of solving a query of your customer; that's the point where human-to-human interactions immediately come into play.

Table of contents

  • Configuring the power virtual agent

    • Modify escalate topic
    • Publish the bot
  • OmniChannel handover

    • Configure power virtual agent handover
    • Create application registration
    • Setting up OmniChannel for customer service
    • Configure OmniChannel for customer service
    • Create a queue
    • Create a workstream
    • Add a RuleSet
    • Add Bot to workstream
    • Add context variables
  • Test Handover

  • Conclusion

Configuring the Power Virtual Agent

Modify Escalate topic

First, we need to modify the default "Escalate" topic to display a meaningful message and handover to the human.

Modify the "Message" node with a meaningful message and insert a new "Transfer to Agent" node. By now, we leave the handover to the agent node empty, but this is where you could insert a summary for the human agent.

Publish the bot

After creating your Power Virtual Agent and modifying your "escalate" topic, it is time to publish your work to make it visible to the outside world.

OmniChannel Handover

Configure Power Virtual Agent handover

It would be best if you had a working Dynamics 365 Customer Service environment to work with Omnichannel and human handover. As this is a Kickstarter, I will demonstrate how to start from nothing; you could even start with a 30-day free Dynamics 365 Customer Service trial.

First, we need to activate Agent Transfer with Omnichannel.

We enable voice as we will use it in the second part of this Kickstarter. If there is no active subscription for D365 Customer Service, we can enable a trial and select the created environment to use with Omnichannel.

Create Application Registration

After configuring these initial steps, we need to create an Application Registration in our Azure Active Directory. We go to the Azure Portal and select Application Registrations and "+Add".

We give it a speaking name and select "Accounts in any organizational directory".

After saving, we can get the Application ID of the Registration (red)

and paste this ID to our Agent Handover Configuration in Power Virtual Agent.

Setting up OmniChannel for Customer Service

We need to add some extensions to our environment, to add some features, but everything you see below will work without any extension installed.

For only text (messaging) hand-off

Install Omnichannel Power Virtual Agent extension.

If you still see the following warning after installing the Omnichannel Power Virtual Agent extension and don't need voice capabilities, you can safely ignore it.

For both text and voice hand-off

Install the following extensions in this order:

  1. Power Virtual Agents telephony extension
  2. Omnichannel Power Virtual Agent extension
  3. Omnichannel Voice Power Virtual Agent extension

Configure Omnichannel for Customer Service

Next, we will create a Queue, a Workstream, and Ruleset.

First, go to yourtenant.crm.dynamics.com/apps

Select the "Customer Service admin center App"

Create a Queue

We create a separate Queue for Customers asking for human-to-human interaction.

We select the Type "Messaging" as a queue type.

and add some agents after completing it.

Create a Workstream

After creating the first queue, we generate a workstream to select the Work distribution mode and the fallback queue.

Next, we create a chat widget; you could use a different, more customizable chat window configuration. You can find an example in my "Create your first (voice-) bot" article.

Click "Set up chat" and configure it accordingly to the screenshots.

Add a RuleSet

Next, we create a ruleset for handling the users.

and create a new rule.

We do not need to configure a condition, as we want to allow every user to enter the queue and assume you have a 24/7 service.

Add Bot to Workstream

We add our bot via smart assist bots' settings in the Advanced settings area.

Add Context Variables

We need to add a first context variable to the workstream. We will use the va_Scope Variable.

Test handover

Let's test the handover.

Go to your workstream, copy the code for the snippet, create an empty HTML-File, and paste the copied code into the body.

You will end up with something looking like this.

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<script id="Microsoft_Omnichannel_LCWidget" src="https://oc-cdn-public-eur.azureedge.net/livechatwidget/scripts/LiveChatBootstrapper.js" data-app-id="your data" data-lcw-version="prod" data-org-id="your data" data-org-url="https://your data.crm4.omnichannelengagementhub.com"></script>

</body>
</html>

Open the HTML File with your Browser and start chatting.

Ask the bot for a human agent.

In your D365 Agent Dashboard, you should see an incoming chat and can talk to yourself.

The agent can see the customer's dialog with the bot on the left side.

And can start to chat with the customer.

Conclusion

Self-service helps you provide 24/7 effective and efficient customer service; with the integration of human handover, you can keep your customer satisfaction high.


Featured image by ThisisEngineering RAEng on Unsplash

Also published here.


Written by thecognitiveservicesninja | Code Fanatic | Low Code Hacker | Bot Keeper | Power Platform & Azure Architect | Developers Advocate
Published by HackerNoon on 2023/04/20