Configure hand-off to Dynamics 365 Customer Service
When your customers need to speak with a human agent, your bot can seamlessly hand off the conversation. With the omnichannel capabilities of the Chat Add-in for Dynamics 365 Customer Service, you can connect both voice and text conversations.
When your bot hands off a conversation, it shares the full history of the conversation and all variables collected in the interaction. Your Omnichannel for Customer Service routes incoming escalations to the right queue, and a live agent can seamlessly resume the conversation. For more information about how to use hand-off in bot conversations, see Hand off to a live agent.
You can also enable single sign-on (SSO) to allow chatbots to sign users in if they're logged in to the page where the bot is deployed. For more information, see Configure single sign-on and Pass authentication token to bot during single sign-on in live chat.
Prerequisites
- Learn more about what you can do with Power Virtual Agents.
- Sign in with an account that has the System Administrator role.
- Have a product license for Power Virtual Agents and a product license for the Chat Add-in for Dynamics 365 Customer service.
- Environments:
- Your bot environment and Omnichannel for Customer Service environment must be in the same geographical region.
- To use voice capabilities, your tenant and environment must be in the United States, Canada, Europe, Asia, United Kingdom, or Australia geographies.
- Register an application with Azure AD.
- For end-to-end capabilities to work as expected, your bot must be published.
Connect your bot to Omnichannel for Customer Service
Note
If you connected your bot to Omnichannel for Customer Service engagement before November 2021, the settings on the Omnichannel tile will look as if they haven't been configured. This is a known issue. It doesn't affect the bot or its omnichannel capabilities, which will continue to run normally. Select Enable to refresh the settings and show the actual connection details.
In Power Virtual Agents, edit your bot. In the navigation menu, select Settings, Agent transfers, and then select the Omnichannel tile.
Select Enable.
If the required extensions aren't installed, you'll see a message that your bot doesn't have access to the variables or actions it needs.
If you're using Application Lifecycle Management (ALM), you may see a message that we can't determine if Omnichannel for Customer Service integration is enabled for the environment. For more information, see Bots with ALM.
Under See the environment this bot is connected to, select the environment where you have Omnichannel for Customer Service integration turned on. If your bot and Omnichannel for Customer Service are in different environments, Analytics for Omnichannel for Customer Service won't work for your bot.
If you haven't set up Omnichannel for Customer Service in that environment, you'll see a message inviting you to begin a trial.
Select See how to register a new Application ID and follow the steps to find or create the app registration for Power Virtual Agents.
On the Azure portal go to App registrations, then select Overview. Copy the Application (client) ID.
Return to the Omnichannel pane in Power Virtual Agents and paste the Application ID in the Application ID box.
Important
Omnichannel for Customer Service models bots as "application users." Therefore, the Application ID that you use must be unique to your Microsoft Dataverse organization or environment.
Select Add your bot.
Power Virtual Agents uses a Teams channel to communicate with Omnichannel for Customer Service. If one isn't turned on, a Teams channel will be enabled when you select Add your bot.
Select the View details in Omnichannel link to continue configuring the bot connection in Omnichannel for Customer Service.
Important
To test the bot on your custom website, you must use the embed code that's specified in the chat widget you set up in Omnichannel for Customer Service. If you use the embed code from Power Virtual Agents, hand-off won't work. For more information, see Embed chat widget in your website or portal.
To add voice capabilities after you've connected your bot to Omnichannel for Customer Service, you must disconnect the bot from your Omnichannel for Customer Service and reconnect it.
Bots with Application Lifecycle Management
If you've set up Application Lifecycle Management (ALM) for your bots, and are exporting and importing bots between development (unmanaged) and test or production (managed) environments, you might see a message that we can't determine if Omnichannel for Customer Service integration is enabled for the environment.
If the bot you exported has omnichannel capabilities enabled, you can ignore this message. The bot will still work properly. The message will disappear after you export the latest version of your bot from your development environment, and then import it into a targeted test or production environment with managed bots.
If you continue to see the message after exporting and importing the latest version of your managed bot, make sure to remove any unmanaged layers:
Sign in to Power Apps and select the managed bot's environment.
In the navigation menu, select Solutions, and then select the solution that contains the bot with the unmanaged layer.
Next to the chatbot component in the solution, select More commands (⋮), and then select See solution layers.
Select the unmanaged layer, and then select Remove unmanaged layer.
If your bot doesn't have omnichannel capabilities enabled, the message will always show.
Manage your bot's omnichannel capabilities
Select Settings, Agent transfers, and then select the Omnichannel tile. Here you can disconnect or disable your bot, refresh the connection, or open the Omnichannel for Customer Service admin center to view the connection details.
Disconnect your bot from Omnichannel for Customer Service or disable the connection
If you select Disconnect bot, the application user that represents the bot in your Omnichannel for Customer Service instance is disabled. Your bot is effectively disconnected from the Omnichannel for Customer Service environment.
To add your bot back, you'll need to connect it again, starting at Step 3.
If you select Disable, the connection between your Omnichannel for Customer Service instance and Power Virtual Agents is disabled. Your bot will stop receiving any traffic from your Omnichannel for Customer Service instance.
Refresh the connection
If you select Refresh, the connection between your bot and the Omnichannel for Customer Service instance is tested and verified.
It's a good idea to refresh the connection after you add your bot to an Omnichannel for Customer Service workstream to make sure that the connection was successful.
Voice-based capabilities
The Power Virtual Agents telephony extension adds several actions and variables to Power Virtual Agents.
Select Enable voice to turn voice capabilities on or off for the entire bot, not for individual bot sessions or connections. When voice is enabled, any connection with the bot can use voice, text, or both voice and text.
Important
If a bot is connected to an Omnichannel voice workstream or queue and taking calls, and the voice is disabled, the calls will start to fail. Ensure that the bot is disconnected from Omnichannel workstreams or queues before disabling voice in the Power Virtual Agents configuration.
Set survey consent
Use this action to ask callers if they're willing to take a survey at the end of their call.
Select Add input for destination topic, and then select surveyConsent (boolean).
Select Yes or No, or enter a custom response.
Set customer locale and handoff to Omnichannel for Customer Service
Use this action to ask callers for their preferred language.
Select Add input for destination topic, and then select customerLocale (string).
Select a variable that defines the locale code, or enter a locale code.
Refer to the list of languages supported in Omnichannel for Customer Service for valid locale codes. Only a subset of these languages is supported in Power Virtual Agents. For more information, see Supported languages.
Send uninterruptible voice message
Use this action to send a voice message that the caller can't interrupt.
Select Add input for destination topic, and then select UninterruptibleMessage (string).
Select a variable that defines the message content, or enter a message.
Transfer the call to a different phone number
Use this action to transfer the call to a different phone number.
Select Add input for destination topic, and then select TargetPhoneNumber (string).
Select a variable that defines the phone number to transfer the call to, or enter a phone number.
Warning
Don't add a plus symbol, "+", before the phone number.
The phone number you enter must have the "Make calls" privilege. Without it, transfers to the number will fail.
Hang up
Use this action to end the call.
bot.CustomerPhoneNumber
This variable contains the customer's phone number. It's also known as CallerID.
You can use the "Is Empty" condition with bot.CustomerPhoneNumber
to find out the customer's communication channel. If the conversation is from a call, "Is Empty" always returns False. If it's from messaging, "Is Empty" always returns True.
bot.OrganizationPhoneNumber
This variable contains the phone number the customer dialed.
Dynamics 365 variables
Dynamics 365 Customer Service provides more context variables for Power Virtual Agents bots.
Authoring considerations
Authentication isn't supported for voice-based hand-off to Omnichannel for Customer Service instances. If you've set up authentication for your bot, the authentication variables don't include authentication information when they're sent to your Omnichannel for Customer Service instance.
Warning
For voice-based hand-off capabilities to work, both your bot and Omnichannel for Customer Service environments must be hosted in a datacenter in the United States, Canada, Europe, United Kingdom, Asia, or Australia geographies. Otherwise, voice capabilities don't work, and you won't receive any error messages or warnings.
If your bot incorporates adaptive cards, make sure you use Bot Framework Composer so that the voice bot correctly reads their "speak" property.
If your topics include Markdown content, the voice bot will read the asterisk (*). Adjust your Markdown content accordingly, and always test your bot using voice to make sure you get the desired result.
Known limitations
See limitations when using Power Virtual Agents with the Chat Add-in for Dynamics 365 Customer Service.
Recommended extensions
The following extensions aren't required to hand-off to Omnichannel for Customer Service, but they provide bot authors with a better experience by providing extra variables and actions.
Typically, the extensions are automatically installed in your Omnichannel for Customer Service environment. However, if the environment that you connected Omnichannel for Customer Service to isn't the same environment your bot is in, you'll need to manually install the extensions.
For both text and voice hand-off
Install the following extensions in this order:
- Power Virtual Agents telephony extension
- Omnichannel Power Virtual Agent extension
- Omnichannel Voice Power Virtual Agent extension
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 you don't need voice capabilities, you can safely ignore it.
Feedback
Submit and view feedback for