Lindsay T Shelton

From Concept to Chatbot: ServiceNow with Copilot Studio - Part 1

Posted on September 8, 2024  •  6 minutes  • 1262 words
Table of contents

Head back to the intro post to get the use case and architecture of the Copilot Studio bots I’ll be describing in these blog posts.

In this post, I’ll be giving a general overview of Copilot Studio, Topics which are the main thing I utilized (though there’s much more that can be used), how I figured out troubleshooting the bot, and the Power Automate flows used in the initial POC I built.

Introduction

Copilot Studio is a low-code platform within Microsoft’s Power Platform, designed to enable the creation of intelligent apps and automation using natural language processing, AI, and automation capabilities. It empowers users to build custom chatbots, applications, and workflows without needing extensive coding knowledge.

Key features include:

  1. Natural Language Integration: Copilot Studio uses conversational AI to understand natural language, making it easy to build chatbots that can interact with users in a human-like manner.
  2. Low-Code Environment: The platform provides a visual interface where users can design workflows, chatbots, and integrations by clicking to add and remove components. It uses PowerFx, a formula-based language, for building logic and managing data.
  3. Integration with Microsoft Power Platform: Copilot Studio seamlessly integrates with other Power Platform services such as Power Automate, Power Apps, and Power BI, allowing chatbots to trigger workflows, retrieve data, and display information.
  4. AI-Driven Automation: The platform allows users to create chatbots that automate tasks by responding to user requests, retrieving information from databases, and even connecting to external systems like ServiceNow, which is what you will see in this chatbot. In summary, Copilot Studio is designed to streamline chatbot creation, making it an ideal tool for businesses looking to implement conversational AI without heavy coding. Its integration capabilities and natural language processing make it highly adaptable for automating various processes.

Topics

In Copilot Studio, a “topic” is a fundamental concept used to define the specific conversations or tasks a chatbot is designed to handle. Topics are essentially the building blocks of the chatbot’s conversational flow, guiding how it interacts with users and responds to their inputs.

Key Aspects of Topics in Copilot Studio:

  1. Defining Conversations: A topic represents a particular subject or intent the chatbot is trained to manage. For example, in a ServiceNow chatbot, there might be topics like “Check Ticket Status” or “Create a New Incident”. Each of these defines a unique conversation path.
  2. Trigger Phrases: Topics are activated by trigger phrases, which are specific words or sentences a user might say to initiate that topic. For example, the topic “Check Incident Status” could have trigger phrases like “What’s the status of my incident?” or “Track my ticket.” The chatbot listens for these phrases and, when detected, activates the corresponding topic.
  3. Dialog Flow: Once a topic is triggered, it defines the dialog flow, or the step-by-step conversation the chatbot follows. This includes asking the user for necessary information, performing actions such as retrieving data from external systems, and responding with relevant details.
  4. Actions and Automation: Within a topic, you can define actions the chatbot should take, such as calling external APIs, triggering workflows in Power Automate, or retrieving data from a database like Dataverse. For instance, in the “Check Incident Status” topic, the chatbot can retrieve incident details from ServiceNow based on user input.
  5. Multiple Topics: Chatbots in Copilot Studio can manage multiple topics simultaneously. If a user asks for a variety of tasks, such as checking an incident and then creating a new one, the chatbot can handle transitions between topics smoothly, maintaining context throughout the conversation through the use of global variables.
  6. Customizable and Expandable: Users can create custom topics to fit their business needs. This flexibility allows the chatbot to cover a wide range of use cases, such as answering FAQs, providing support, or automating complex processes.
  7. Fallback Topics: Copilot Studio also supports fallback topics to manage situations when the chatbot doesn’t understand the user’s intent. In this case, the chatbot can either ask the user to clarify or provide alternative suggestions, ensuring that the conversation doesn’t abruptly end.

Topics in this POC

There are two categories of topics in Copilot Studio – custom and system. Both can be modified, but the key difference is that system topic triggers tend to have triggers for scenarios that happen with chatbots, such as the user providing a phrase similar to but not exactly the same as a trigger phrase you’ve provided in a custom topic trigger. For example, the “Multiple Topics Matched” system topic, which is automatically created, prompts the user with, “To clarify, did you mean:” and a list of actual topic options that you’ve created to select from.

These are the custom topics for this POC that I’ve built (with Goodbye, Greeting, Start Over, and Thank You automatically created when you build a new bot):

Placeholder

These are the system topics, with most of the modification made to the first three topics:

Placeholder

Power Automate Flows

One lesson learned is that, when trying to do certain actions or manipulate data, it was much easier at this point in Copilot Studio’s maturation to call Power Automate flows instead, which you can easily do in the context of a Copilot Studio topic, both feeding it inputs and receiving outputs from the flow.

A few tips on these flows:

Placeholder

So, on each of the flows that were built for this POC, these were replaced with the legacy trigger and end action: Placeholder

They work almost exactly the same, but the newer ones sometime seem to require extra authentication steps inexplicably.

There were six flows created for this initial project that are in the final POC, and they are all premium flows because both the ServiceNow connector and the HTTP connector, which ultimately proved to be more reliable and maneuverable, are premium connectors. The six flows are here, and they will be thoroughly documented in later parts of this series: Placeholder

Troubleshooting the Bot

The troubleshooting options aren’t fantastic in Copilot Studio yet, but here are a few tips:

I’ll see you in part 2, where we get into the nitty-gritty of the first topic, Conversation Start!

Want to contact me about your own Copilot Studio ServiceNow bot? Do so below!

Follow me

Follow along for Power Platform, M365, and cat goodness