Create your Copilot With Your Own Sharepoint Data

In this article, we will learn how to Create a Custom Copilot that works on your SharePoint  Documents,  Before we jump into the how part, it is important to understand the why part.

Why create a Custom Copilot or Bot on your own data and, in this case, your SharePoint documents? I can briefly list some of the important reasons to do SharePoint integration with Custom Copilot.

  • Personalized GPTs or Copilots
  • Rolling out Copilot within the organization which works on your private or enterprise data
  • Create use case-specific bots for your organization department,
  • FAQ bots like HR Policy Bot, Leave Policies, Sales Enablement Bot, TimeSheet Bot,
  • Contracts Helper Bot
  • Utilizing the capabilities of Generative AI with the Power of low-code
  • Easily publish the Bot the Teams.

Let us see now step by step on how to create an Copilot with works on your SharePoint data,

Step – Create a New Copilot Studio Bot

Go to https://copilotstudio.microsoft.com/ Click on New Copilot

 

Provide the name of Copilot, Choose language, it does support other languages also.

if you want to create it in particular solution – click on the Advance option select Solution name and schema and click create

Once created you will see the below screen

Step – Configure Power Platform Environment

To use the Generative AI feature, we need to enable one setting at the Power Platform Admin center.

Go to Power Platform Admin center, Select target environment, on below right of the page, we see will Generative AI feature section, Click on Edit and enable Move data across regions. This is required because Azure Open AI service my be storing and processing the data that we feed outside of our environment’s geographic region.

 

Step – Setup Authentication.

As we need to enable the SharePoint site as one or source part of our Generative answers, we would need to enable Authentication for our copilot.  Let us enable that.

This is required because by default the Copliot with SharePoint works as with the current logged-in user’s context, so it is default security trimmed hence if any user who does not have access to that SharePoint site will not see results.

On the main screen Expand Settings->Click on Security and then Authentication

We would need to setup Manual Authentication for SharePoint integration, so select Manual(for custom website)

Now, we will notice that it is asking for the client ID and secret. Therefore, our next step is to set up Azure AD App Registration.

Step – Setup Azure AD App Registration

This is mostly straightforward, but for the sake of simplicity, I will just share the high-level steps and a screenshot to help us understand the necessary configuration.

  • Go to https://portal.azure.com/
  • Search for Microsoft Entra ID(formerly Azure AD)
  • Click on App Registration
  • Create a Registration (Give it a name and you can select either single tenant or multi-tenant)
  • Go to API Permission and give the below delegated permissions

  • Go to Expose an API, Click on Add Scope, and Give the name of scope as per your preference.

 

The next step is to create a secret. Click on Certificates & Secrets, then click on New Secret. Copy the secret, as we will need it in the next step.

Step – Configure Authentication

Next, Go back to copilot Security->Authentication and add client id and client secret.

Add Scopes as below “profile openid Sites.Read.All Files.Read.All”

You will see the below popup, click on Save.

Step – Enable Conversation Booster with Generative AI answer

From the left tab – Click on Generative AI.

To add custom SharePoint sources, we first need to enable Boost Conversation coverage, which you can find at the bottom of the page.

Once you enable this, we will see the “Add public website & SharePoint source” enabled.

Add your SharePoint site URL where we have our documents uploaded which we wanted to make searchable by the copilot bot which is our data source.

Step – Validate that the Conversational boosting System topic is added to the copilot

Go to Topics and Plugins on the left side. Select the System tab and check if a conversational boosting topic with unknown intent is triggered or not.

It is essentially a fallback. If none of the topics match the user’s message, it will go to these topics to execute the logic. It would have automatically added the following actions.

On Create Generative Answers, if you click on Edit data sources, we will see below options

Here we can see our SharePoint URL which we added previously, optionally you can add more URLs here(up to 4). You can also add a public website if you want your copilot to respond to your website content.

Step – Test the Copilot.

Now everything is set, and we can go ahead and test the bot. It should first ask you to log in. Clicking on the button will take you to a new page and give you a validation code, which we have to enter as a message once logged in. Then, ask for something relevant to the documents being uploaded, and it should respond.

Once you click on login, it will take you to page like below, copy this code and paste it in above chat window.

On successful login, it will show how the welcome message

In my case, I have uploaded some resumes of people and it is responding with finding information from documents. In this case my resume and Intro slide document

 

Note – It is also advisable and gives you more accurate results if you provide instruction to generative answer node about the purpose of bot, what is data source and some example queries user will ask. This will help the Open AI to understand the context and respond accordingly.

Happy Coding..!!! and this time also Happy Copiloting..!!!

(Visited 147 times, 1 visits today)