Connect to ServiceNow

This document provides step-by-step instructions on how to create and connect a ServiceNow Virtual Assistant to a Copilot bot and escalate it to ServiceNow Live Agent. This integration allows you to use the capabilities of both platforms and generative answers to enhance your chatbot experience.

Prerequisites

Before you begin, make sure that you have the following prerequisites in place:

  • An active ServiceNow account with ServiceNow Virtual Agent enabled and ServiceNow Bot Interconnect enabled (ServiceNow Vancouver or later required)
  • A Copilot Studio bot
  • Admin or developer access to both ServiceNow and Power Platform

Steps

Follow these steps to create and connect a ServiceNow bot to a Copilot Studio bot:

  1. Create a JavaScript function in Microsoft Azure using Visual Studio Code.

    1. Sign in to Microsoft Azure.

    2. Create a JavaScript function in Microsoft Azure.

    3. Create an Azure Function for Microsoft Copilot Studio as Secondary bot with Servicenow Bot Interconnect setup (KB1112368)

    4. Install the request-promise libraries.

    5. Deploy the project to Azure.

    6. From the Azure portal, navigate to All Resources.

    7. Click the name of the function app that you created.

    8. On the Overview page for the function, copy the function URL and keep it for use in a later step. The Azure function URL is used as the secondary bot endpoint in your ServiceNow instance.

  2. Retrieve Direct Line secret for your bot.

  3. Add the Direct Line secret key to your Virtual Agent Bot Interconnect instance.

  4. Create a Virtual Agent Bot Interconnect shell topic to call Microsoft Copilot Studio topics.

  5. Create a Virtual Agent conversational custom chat integration configuration.

    1. Create a new channel or update an existing channel for the integration.

    2. Configure a new provider for the integration.

    3. Set up message authentication.

    4. Create a channel identifier.

    5. Select rich controls for inbound (user input) and outbound (bot response) transformation.

    6. Create and configure a scripted REST API for your custom chat integration.

    7. Create the action scripts.

  6. Configure iFrames for agent interface so the bot can be accessed within ServiceNow.

  7. Close virtual agent chat conversations.