Set up Omnichannel for Customer Service live chat

Completed

In this exercise, you set up live chat for Omnichannel for Dynamics 365 Customer Service. Omnichannel for Customer Service offers a suite of capabilities that extend the power of Dynamics 365 Customer Service Enterprise. With these capabilities, organizations can instantly connect and engage with customers across digital messaging channels.

In this exercise, you complete the following tasks:

  1. Assign the Omnichannel agent security role to your user and the bot user.

  2. Create an application user with the MCH Application ID and your bot ID.

  3. Set up queues for bot and agent users.

  4. Set up a workstream to define a chat channel with a context variable and routing rule to route the message to a bot or an agent.

Task: Assign the Omnichannel agent security role

To assign the Omnichannel agent security role, follow these steps:

  1. While in an InPrivate or Incognito browser, go to Microsoft Power Apps.

  2. Select your environment from the Environment dropdown menu in the upper right.

  3. Select the gear icon in the upper-right corner and then select Advanced settings.

    Screenshot of the environment Settings menu with Advanced settings selected.

  4. A new window should open showing the Business Management section of Dynamics 365. If loading takes a while, reload the page.

    Screenshot of the Dynamics 365 Business Management section.

  5. On the upper command bar next to Dynamics 365, select Settings to open the dropdown menu. Select Security in the third column under System.

    Screenshot of the Business Management Settings page with the Security option highlighted in the System menu.

  6. Under Security, select Users.

    Screenshot of the Users option in the Security section.

  7. Switch the grid view dropdown menu from Omnichannel Users to Enabled Users so that you can view the user in the list.

    Screenshot of the Omnichannel Users menu with the Enabled Users option highlighted.

  8. In the Enabled Users list, scroll or use the search bar to find your user.

    Screenshot of search results in the Enabled Users view.

  9. Select your user for the training and then select Manage Roles on the upper command bar.

    Screenshot of selecting Manage Roles on the command bar after selecting your user.

  10. Select the Omnichannel agent role to assign to your user and then select OK.

    Screenshot of the Manage User Roles dialog with Omnichannel agent selected under the Role Name section.

You now assigned the correct Omnichannel agent role to the user, which allows you to be a live agent in Omnichannel.

Task: Create a Health Bot user in Dynamics 365 Customer Service

You need to set up two users in Omnichannel for Customer Service:

  • Health Bot User - The Azure AI Health Bot user that you created in the previous exercise. This configuration allows you to assign the bot as a user and take initial messages through live chat.

  • Omnichannel Agent User - The current user account that you used to sign in to Dynamics 365. This configuration allows you to be a live agent in Customer Service who receives messages from portal users through Azure bot escalations.

In this task, you create a bot user, which helps you connect Azure AI Health Bot with Omnichannel live chat.

  1. Open a new tab and go to Microsoft Power Platform admin center.

  2. Search for and select your Lamna Healthcare Company environment from the list.

  3. Select the Settings button on the upper command bar.

    Screenshot of the Settings button on the Environments Details page.

  4. Expand Users + permissions and then select Application users.

    Screenshot of the Users and permissions dropdown menu with the Application users option selected.

  5. Select the + New app user button to create a new application user.

    Screenshot of the New app user button.

  6. Select + Add an app on the Create a new app user page.

    Screenshot of the Add an app option on the Create a new app user page.

  7. Paste the Application ID (the Application (client) ID that you obtained in the Azure portal for the supplied MCH Application ID) into the search box and then select the app from the list. You can also search for mch. Select Add.

    Screenshot of the application ID settings.

  8. Select a Business unit from the dropdown list (the options in the list are unique for each Dynamics 365 environment). Select Create in the lower right of the page. If the application user is already created, skip this step.

    Screenshot of the Create a new app user view.

  9. Return to the Dynamics 365 User page that you previously accessed through Advanced settings. Switch the view to Enabled Users if you're not already on it. Clear the search terms, if any.

  10. While in the Enabled Users list, search for MCH Application ID or scroll to find the bot app user. Double-click the user or select the row and then select Edit.

    Screenshot of the application I D search results.

  11. Above the user name, change the form type from User to Application User.

    Screenshot of the Application User view selection.

    A new form appears, and the User type is Application user.

    Screenshot of the Application User form.

  12. In the User Information section, change the User type from Application user to Bot application user. A new field called Bot application ID displays.

    Screenshot of the Bot application user selection in the User type dropdown menu.

  13. Add your details to the Bot application ID. This ID is the Azure AI Health Bot ID that you previously noted when you enabled the Teams and Omnichannel channels. This field displays after Bot application user is selected as the User type.

    Screenshot of the Bot application I D field filled out in the form.

  14. Select Manage Roles on the command bar.

    Screenshot of the Manage Roles option highlighted on the command bar.

  15. Assign the Omnichannel agent role to the bot user as you did for your own user in the previous task. This action allows the bot to act as an omnichannel agent like your user.

    Screenshot of adding the Omnichannel agent role to the bot user.

  16. Select the Omnichannel Administrator role for your user ID and MCH Application ID users.

    Screenshot of the Omnichannel administrator and agent roles assigned to the bot user.

You successfully created a bot user and have assigned the Omnichannel agent role to it.

Task: Create and set up human agent queues

You can use queues to collect and distribute workload among agents. As a result, agents are added as members to the queues and the workload is distributed among the agents based on assignment methods. For more information, see Manage queues for unified routing.

In this task, you create the omnichannel queue that's necessary for communicating with a human agent.

  1. Switch back to the tab with Power Apps, select All and then Apps in the navigation pane, and open the Customer Service admin center app.

    Screenshot of the Apps menu with the Customer Service admin center option selected.

  2. You should be on the Home page. Select Guided channel setup on the navigation pane and select Start new. You can automatically create a custom chat channel, queue, and workstream to help connect users to bots and human agents.

    Screenshot of the Customer Service admin center Home page with the Begin button highlighted next to Guided channel setup.

  3. On the Name your setup page, in the Setup name field, and enter the name Healthcare Training. Select Next.

    Screenshot of the Name your setup page, showing the name entered in the Setup name field.

  4. Select Chat as the channel type. Select Next.

    Screenshot of the Chat category selected for the channel type.

  5. Select Continue setup on the Summary page.

    Screenshot of the Summary page for the channel setup.

  6. Select Next on the following two screens, which discuss creating user accounts and assigning security roles.

    Screenshot of information on creating user accounts.

    Screenshot of information about assigning security roles.

  7. In the Define a queue page, create a queue called Escalate to Human, which manages and redirects the incoming messages from a user to a Customer Service (human) agent when the bot sends the user through to a live agent. Create the new queue with the following details:

    • Name - Escalate to Human
    • Type - Defaults to Messaging

    Screenshot of the Define a queue form.

  8. Select Next.

  9. Select your user to add to the queue. Select Next.

    Screenshot of adding your user to the queue.

You now created the necessary queue to escalate to a human agent and have added your user to the messaging queue. Now, you can create the workstream to initially route to a virtual bot, along with routing rules to direct the user to the Escalate to Human queue in the proper conditions.

Task: Update the live workstream with context variables and routing rules

A workstream is a container to enrich, route, and assign work items, and it's associated with a channel, such as live chat, voice, or case. After a bot is added to a workstream, the incoming work item will be routed to the selected bot at runtime based on classification rules. For more information, see Create workstreams for unified routing.

In this task, you set up basic chat routing with a new workstream. This setup allows users to chat with a bot user initially and then route to a live human agent in the proper situation.

You complete the following tasks:

  • Create a new channel and workstream.

  • Turn on proactive chat for the channel.

  • Add a bot for initial routing: Initial customer conversation is directed to the Azure AI Health Bot.

  • Create a context variable and routing rule to escalate to a human agent. When context variable EscalateToAgent is present and set to 1, route to the Escalate to Human queue that you previously set up with your user so that an agent can continue the conversation.

  1. While continuing the guided setup from the previous task, enter a Chat name and Chat language for your channel and a workstream Name. Keep the Work distribution mode as Push and then select Next.

    • Chat name - Chat Widget

    • Workstream Name - Chat Workstream

    Screenshot of the create a channel and workstream form.

  2. Define a ruleset that allows work from this channel to be routed to the Escalate to Human queue. Name the Routing rules as Human Agent and the Rule item as Human Agent Rule. Select Next.

    Screenshot of the setup page to define a routing ruleset.

    Note

    On the Define a Chatbot page, select Skip for now and select Next.

    Screenshot of the notification that, by default, conditions can't be set and all items are routed to the queue.

  3. It takes a moment for the system to create the chat channel and workstream. When the process is complete, make sure that you Copy the chat widget snippet code and store it for later. Select Go to home.

    Screenshot of the Chat setup complete dialog, showing the Copy button to copy the chat widget snippet code.

  4. You still need to set up a few components for the routing to happen correctly:

    1. Enable proactive chat for the chat channel so that the bot can prompt the user.

    2. Add the bot user in the default messaging queue so that conversations initially route to the bot.

    3. Add the default messaging queue as the fallback queue for the new workstream.

    4. Define the routing rule in the workstream for escalating to a human agent.

  5. Go to Overview on the navigation pane. Select Chat in the Channels section to view all chat channels.

    Screenshot of the Overview page with the Chat category highlighted in the Channels section.

  6. Select the newly created chat channel, Chat Widget, and then select Edit on the command bar.

    Screenshot of the Chat channels subgrid, showing the Chat Widget channel and the Edit button highlighted.

  7. In the Chat channel settings form, select the Chat widget tab and then turn on Proactive chat. This setting allows the bot to prompt the user on the website where it's embedded. Select Copy to copy the chat widget code and store it for later use, if you haven't done so already. Select Save and close.

    Screenshot of the Chat widget tab in Chat channel settings with Proactive chat enabled.

  8. Return to Overview on the left navigation pane. Scroll down to Workstreams and then select Chat.

    Screenshot of the Overview page with the Chat category highlighted in the Workstreams section.

  9. Select Chat Workstream and then select Edit.

    Screenshot of the Chat Workstream option in the All workstreams subgrid.

  10. In the Chat Workstream record, select Edit for the Fallback queue.

    Screenshot of selecting Edit for the Fallback queue.

  11. Select the Default messaging queue (All users) from the Choose existing dropdown menu. Select Save and close.

    Screenshot of selecting the Default messaging queue as the fallback queue.

  12. The updated fallback queue displays. Select + Add bot to add the Azure AI Health Bot for initial routing.

    Screenshot of the Chat Workstream page and the selection of Add bot.

  13. Select your bot user from the Name dropdown menu. Select Save and close.

    Screenshot of selecting the bot user from the Name dropdown menu.

  14. The bot user has been added. Now, you need to edit the ruleset so that the queue properly escalates to a human agent. First, you need a number variable to use with your escalation logic. On the lower-left corner of the Workstream page, select Show advanced settings.

    Screenshot of the Show advanced settings selection in the lower-left corner of the Workstream page.

    Screenshot of the Show advanced settings button.

  15. Review the advanced settings for the workstream and then select + Add context variable.

    Screenshot of selecting the Add context variable option.

  16. In the Add context variable screen, select + Add. Create the new context variable, which you use to determine whether you need to escalate to an agent or not. Enter EscalateToAgent as the Name and then select Number from the Type dropdown menu. Select Create.

    Screenshot of adding context variable details.

  17. The EscalateToAgent context variable of the Number type should show as added. Close the Context variables screen.

    Screenshot of the Context variables subgrid.

  18. On the workstream record, select Advanced Settings to collapse it. Select Human Agent under Ruleset name.

    Screenshot of the ruleset name in the Routing rules area.

  19. Select Human Agent Rule and then select Edit.

    Screenshot of the Human Agent routing subgrid with Human Agent Rule highighted in the Decision list.

  20. Delete the initial condition in the rule to start with a blank canvas. The logic to follow is having the workstream route the chat channel to a human agent if the EscalateToHuman context variable is equal to 1 in any bot conversation.

    Screenshot of the Edit route to queue rule wizard.

  21. Select Add > Add related entity to add a new condition.

    Screenshot of selecting Add related entity from the Add dropdown menu.

  22. Select Context item value (Conversation) from the dropdown menu to have the routing rule check if conversation context values contain specific data.

  23. After you select Context item value (Conversation), the following dropdown menu populates with contains data, and a sub condition appears. Select the new EscalateToAgent context variable, and then set it as Equals to 1 in the condition. This setting allows bot conversations to route to a human agent if that variable is ever set to 1. You view this result in the last exercise in this module. Select Save and close.

    Screenshot of the Edit route to queue rule wizard with the condition populated.

The Chat Workstream shows Human Agent Rule with the condition that escalates to a human agent when the context variable is set to 1.

Screenshot of Human Agent Rule in the Human Agent ruleset in the Chat Workstream.

You now created a chat channel, workstream, queue, context variable, and routing rule that allows customers to begin a conversation with a health bot and escalate to a human agent.