Chatbot: Accessing SharePoint Documents via Power Virtual Agent — Part 1

Emmanuel Adegor
6 min readSep 21, 2023

In many organizations, both new and existing employees often encounter challenges when trying to locate pertinent documents that can significantly enhance their work productivity or provide valuable employee benefits. These documents could include items such as health policies, 401k plans, organizational charts, How-To guides, and more. While the process of tagging documents in a SharePoint document library greatly enhances their searchability, as opposed to relying on conventional folder structures, it’s worth noting that some employees or customers may not always have the access or the ability to recall precisely what to search for.

Ref: https://google.com

This is where the integration of a chatbot comes into play. With a chatbot at their disposal, a customer or employee can simply make a request for specific IT-related policy documents that are relevant to their needs or beneficial for their work tasks. This chatbot, equipped with the capabilities of Power Automate, can then efficiently navigate through various SharePoint document libraries, pinpoint the required documents, and subsequently furnish the users with the appropriate links to access these documents.

In the ever-evolving landscape of technology, chatbots have emerged as powerful tools to enhance customer engagement, streamline processes, and improve user experiences. Among the myriad of chatbot platforms available, Microsoft’s Power Virtual Agents stands out as a robust and user-friendly solution, catering to a wide range of business needs. In this blog post, we will explore the capabilities of Power Virtual Agent, shedding light on how it can revolutionize your interactions with customers and streamline internal processes.

Ref: https://google.com

In this blog post, we will delve deeper into the features and benefits of Power Virtual Agents, Power Automate, and SharePoint Document Library, exploring how these Microsoft tools can enhance your organization’s efficiency, communication, and overall success. Stay tuned to discover how you can harness the power of these technologies to transform your business processes and customer interactions.

Tools:

Prerequisite:

  • You already have SharePoint, Power Virtual Agent and Power Automate set up.
  • You do not need an advanced knowledge of these tools to get started.
  • Must have created and configured a SharePoint document library with metadata-tagged documents.

Terminologies

  • PVA: Power Virtual Agent
  • PVA Topics: A workflow that defines how a bot conversation plays out. For example, a greeting topic might be when a chatbot greets people and explains what it can do.
  • PVA Entities: Entities are units of information that represent a real-world subject, such as a phone number, zip code, city, or person’s name. Entities help a bot recognize relevant information from user input and save it for later.

Let’s get started!

Ref: https://google.com

N.B:

Your SharePoint document library should contain documents that are tagged just as you can see below:

Steps:

  1. Login to PVA from your Microsoft 365 environment.

2. Click on “Create a bot” from the homepage or on the Chatbot page click “New Chatbot”

3. Input your Bot name and select a language (I’m using English for this tutorial)

4. Click Create

A progress screen is displayed you can see below:

Once the setup process is completed, you’ll be redirected to the chatbot area:

Suppose our primary goal is to empower employees or customers to perform policy searches exclusively within their company or organization. For example: HR policies, IT Policies, Health Policies, etc. Then we have to create a Topic for “Policies”

5. Click on “Topics”

You’ll see a list of pre-existing topics,

6. Click on “New topic”

7. On the new topic page, give your topic a name (I named mine “Policy retriever”)

8. Select “Edit” within the “Phrases” trigger card to input common user-initiated phrases that can serve as conversation starters.

These phrases may include examples such as “policy,” “policies find documents,” “get company health policy,” and others. By doing this, when a user types a statement like “Get me company policy,” “I want health policy,” or “Can you help me find a policy” in the chatbot chat interface, the system will identify relevant phrases within these statements and initiate the conversation accordingly. It’s important to note that the “Phrases” trigger card serves as the entry point for your chatbot’s topic workflow.

9. Click on the “+” icon below the trigger card

10. Click on “Ask a question”

11. Within the “Enter a message” field, provide a response message for users in the form of a question, when they input a statement that contains one of the specified phrases.

For instance, you might respond with something like, “Are you requesting assistance in obtaining a policy document from our organization?”

12. Under the “Options for user” section Click “New option”, and input “Yes” and “No”

13. Click on the choice variable name “Var1”, then rename it to something meaningful (I named mine “isPolicy”).

This will save the response from the question: “Are you requesting assistance in obtaining a policy document from our organization?”

This will automatically add two condition cards below this question card, based on the options “Yes” and “No”

14. Under The “Yes” condition card, click on the “+” icon

15. Add a “Question card”, input the question and options in the screenshot below, then create a new choice variable (I named mine “PolicyCategory”).

This will automatically add four condition cards below this question card, based on the options “Health” , “Compliance”, “Vacation”, “Benefits”

These options are based on the tags I have on my document library

15. Add an action to trigger a power automate workflow that will get the files, when any of these categories are selected.

So far, here’s what the “Topic” workflow looks like:

This blog post is split into two parts. In the upcoming post, I will guide you through the process of initiating a Power Automate workflow directly from this Power Virtual Agent (PVA) and establishing a connection between that workflow and a SharePoint document library, enabling seamless document retrieval on the chatbot.

Ref: https://google.com

STAY TUNED!!

--

--

Emmanuel Adegor

SharePoint Developer | React JS | SPFX | SharePoint Administrator