Prerequisites
Warning
Microsoft Copilot Studio copilots with names that are longer than 30 characters will fail to connect when you follow the instructions in this article. Ensure your copilot's name contains less than 30 characters before you proceed.
Connect your copilot to Omnichannel for Customer Service
In Microsoft Copilot Studio, edit your copilot. In the navigation menu, select Settings, Customer engagement hub, and then select the Omnichannel tile.
Select Connect.
- Note that the OmniChannel installation must be in the same environment as the copilot.
- 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.
Click View in Omnichannel to continue configuring the bot connection in Omnichannel for Customer Service.
Important
To test the copilot 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 Microsoft Copilot Studio, handoff won't work. For more information, see Embed chat widget in your website or portal.
Copilots with Application Lifecycle Management
Suppose you've set up Application Lifecycle Management (ALM) for your bots, and are exporting and importing copilots between development (unmanaged) and test or production (managed) environments. In that case, you might see a message that we can't determine if Omnichannel for Customer Service integration is enabled for the environment.
If the copilot 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 you export and import the latest version of your managed copilot, make sure to remove any unmanaged layers:
Sign in to Power Apps and select the managed copilot's environment.
In the navigation menu, select Solutions, and then select the solution that contains the copilot with the unmanaged layer.
Next to the copilot 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 copilot doesn't have omnichannel capabilities enabled, the message will always show.
Dynamics 365 Customer Service expects a conversation to end after a period of inactivity. This feature is important to ensure the supervisor view displays the correct ongoing conversations and manages agent loads and metrics correctly. When you create a copilot from Dynamics 365 Customer Service, the default bot content includes two topics: Session Timeout Reminder and Session Timeout. These topics use the Inactivity trigger to first remind the user, and then close the conversation after a set inactivity timeout value, which can be configured in the topic. But if you create the copilot from the Microsoft Copilot Studio portal, those topics aren't included in the copilot. To create them, follow the steps below:
Create a Session Timeout topic
From the left navigation, select Topics.
From the top bar, select New topic and From blank.
Hover the trigger Phrases and select the Change trigger icon.
Select Inactivity from the list.
Select Edit in the Trigger node to configure the inactivity duration.
Select a Value from the dropdown, or enter an arbitrary value (in seconds) using a Formula entry. This value is the amount of inactive time it takes for the topic to trigger.
Select which channel it applies to by using the Condition option. For OmniChannel, click on Select a variable under the Condition block, select the System tab, and Activity.Channel.
Select Omnichannel from the dropdown.
Finally, add a message, and at the end, add an End Conversation node so the conversation ends. Click on the (+) sign, select Topic management, and then select End conversation.
Finally, save and publish your copilot.
Manage your copilot's omnichannel capabilities
Select Settings, Agent transfers, and then select the Omnichannel tile. Here you can disconnect your copilot and find the link to go to the Omnichannel for Customer Service admin center to view the connection details.
Disconnect your copilot from Omnichannel for Customer Service or disable the connection
If you select Disconnect, the application user that represents the copilot in your Omnichannel for Customer Service instance is disabled. Your copilot effectively disconnects from the Omnichannel for Customer Service environment and stops receiving any traffic from your Omnichannel for Customer Service instance.
To add your copilot back, you need to connect it again, starting at Step 2.
Known limitations
See limitations when using Microsoft Copilot Studio 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 copilot authors with a better experience by providing extra variables and actions.
Install Omnichannel Power Virtual Agent extension.
Prerequisites
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 Microsoft Copilot Studio, 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 that invites 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 Microsoft Copilot Studio.
On the Azure portal go to App registrations, then select Overview. Copy the Application (client) ID.
Return to the Omnichannel pane in Microsoft Copilot Studio and paste the Application ID in the Application ID box.
Important
Omnichannel for Customer Service models bots as "application users." As a result, the Application ID that you use must be unique to your Microsoft Copilot Studio bot. Reusing an Application ID across bots will cause error code 1004
(DuplicateBotAppId).
Select Add your bot.
Microsoft Copilot Studio uses a Teams channel to communicate with Omnichannel for Customer Service. If one isn't turned on, a Teams channel is 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 Microsoft Copilot Studio, handoff 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 you export and import 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 need to connect it again, starting at Step 3.
If you select Disable, the connection between your Omnichannel for Customer Service instance and Microsoft Copilot Studio is disabled. Your bot stops 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 Microsoft Copilot Studio telephony extension adds several actions and variables to Microsoft Copilot Studio.
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 takes calls, and the voice is disabled, the calls will start to fail. Ensure that the bot is disconnected from Omnichannel workstreams or queues before you disable voice in the Microsoft Copilot Studio configuration.
Set survey consent
Use this action to ask callers if they're willing to take a survey at the end of their call.
Add the action.
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.
Add the action.
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 Microsoft Copilot Studio. For more information, see Supported languages.
Send uninterruptible voice message
Use this action to send a voice message that the caller can't interrupt.
Add the action.
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.
Add the action.
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.
Add the action.
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 Microsoft Copilot Studio bots.
Authoring considerations
Authentication isn't supported for voice-based handoff 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.
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 reads 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 Microsoft Copilot Studio with the Chat Add-in for Dynamics 365 Customer Service.
For limits on the size of variables that are shared with Omnichannel when Microsoft Copilot Studio tranfers the conversation, please see Microsoft Copilot Studio maximum channel data message size limits
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 need to manually install the extensions.
Text and voice handoff
For both text and voice handoff, install the following extensions in this order:
- Power Virtual Agents telephony extension
- Omnichannel Power Virtual Agent extension
- Omnichannel Voice Power Virtual Agent extension
Text (messaging) handoff
For only Text (messaging) handoff, 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.