Add SharePoint as a knowledge source for agents in Copilot Studio.
You can use SharePoint as a knowledge source by pairing your agent with a SharePoint URL or SharePoint list.
- Add a SharePoint site as a knowledge source.
- Update the source link if the SharePoint page or folder is renamed.
- Add SharePoint lists as knowledge sources.
- Advanced authentication scenarios
- SharePoint source filtering
- Use variables as URLs.
- Create filtration conditions
- Add settings to improve search
- Variable support
- Create and set variables
- Example: Limiting the scope by product
- Common cases
- Points to note
This article covers the full range of SharePoint integration functionality provided by selecting the SharePoint option in the Add knowledge dialog box .
Note : In the Add knowledge dialog box , two SharePoint options appear. The SharePoint option in the File Upload section is used to upload individual SharePoint files or folders and enables file synchronization. This article refers to the SharePoint option that provides full SharePoint support in Copilot Studio.
When you use SharePoint as a knowledge source, the conversation log does not include the content of the source documents used to generate the response (field search_results). The question and answer are still included.
For SharePoint knowledge-based agents, Turn on Work IQ provides improved knowledge retrieval and response quality. This feature utilizes advanced internal retrieval tools, allowing agents to gain more context with greater accuracy. However, due to the increased system complexity, some users and queries may experience slight increased latency.
When you publish your agent, calls using generated responses are made on behalf of the user chatting with the agent. The agent uses the authentication settings you configure. By default, agents created in Copilot Studio and in Microsoft Teams are configured with the "Authenticate with Microsoft" authentication option . This option works in environments such as Microsoft Teams , Power Apps, and Microsoft 365 Copilot.
Note : You can use generated responses with SharePoint data in Microsoft Teams chats without manual authentication. To use this method for a previously published agent, reconfigure the agent to use Authentication with Microsoft and then republish it to Microsoft Teams. This may take several hours to take effect. If a user is in a chat and the change doesn't seem to take effect, they can type "start again" in the chat to force the chat to restart with the latest agent version. These changes are currently available for 1:1 Teams chats between a user and an agent. They are not yet available for group chats or channel messaging.
Add a SharePoint site as a knowledge source.
When a user asks a question and the agent doesn't have a topic to use as an answer, the agent searches the URL and all its sub-links. For example, a URL like contoso.sharepoint.com/sites also includes sub-links like contoso.sharepoint.com/sites/policies. The generated answer summarizes this content into a specific response.
To add a SharePoint site as a knowledge source, follow these steps:
1. Open the agent.
2. Select Add knowledge from the Overview or Knowledge page , or Properties of the Generative Answers node.
3. In the Featured section , select SharePoint .
4. Enter the SharePoint URL. Separate multiple URLs using manual line breaks (using Shift + Enter ). To use a variable instead of a static URL, select the variable selector icon next to the URL field and choose Custom , System , or Environment .
5. Add a name and description. Provide a detailed description, especially if Generative AI is enabled, as the description aids in orchestrating generative processes.
6. Select Add to agent to complete adding the knowledge source.
Update the source link if the SharePoint page or folder is renamed.
If you rename the SharePoint page or folder that the knowledge source uses, the existing source link may break, creating a permissions vulnerability. When this happens, the agent may be unable to access the knowledge base.
To restore access:
- Ask your SharePoint administrator to grant the appropriate permissions on the renamed location and create a new source link.
- Open the agent and update the SharePoint knowledge source with the newly created link.
Add SharePoint lists as knowledge sources.
SharePoint lists are a popular way to store data in tabular form and provide quick, easy access to information. Your agent can use these lists as a knowledge source. By adding SharePoint lists as a knowledge source, you create a real-time connection to that source, so the most up-to-date data is used for queries and inferences. Users are authenticated with their SharePoint login credentials, which ensures they have access to the data before your agent responds.
1. Open the agent.
2. Select Add knowledge from the Overview or Knowledge page , or from the Properties of the Generative Answers node.
3. In the Featured section or the File Upload section , select SharePoint .
4. Select Browse items to find the desired list or enter the URL of a specific SharePoint list.
5. When you select Browse items , the dialog box will automatically fill in the My Lists and Recent Lists sections . My Lists only displays lists created within the SharePoint Lists application. All other lists appear in Recent Lists . If you don't see the list you need, open SharePoint and access it; it will then appear in Recent Lists .
You can select up to 10 lists at a time. For best results, use a maximum of 10 lists per agent. Lists containing more than 35,000 rows will affect quality and latency.
Each list is added to the agent's knowledge source as a separate item. To add more lists to the agent, follow these steps again and select add list.
Note : If you want to use a SharePoint list with shared access but it doesn't appear in Recent Lists , paste the list's URL into the URL selection box.
6. After selecting your desired lists, choose Confirm selection .
7. Add a name and description. Provide a detailed description, especially if Generative AI is enabled, as the description aids in orchestrating generative creation.
8. Select Add to agent to complete adding the knowledge source.
Advanced authentication scenarios
By default, Copilot Studio configures agents to authenticate users using Microsoft authentication to access SharePoint sources when they connect to the agent via Microsoft Teams, Power Apps, or Microsoft 365 Copilot. However, if you need to configure manual authentication, the following steps are necessary to make the generated responses work with SharePoint data sources.
Important note : If Restricted SharePoint Search is enabled, SharePoint usage will be blocked.
- Answers automatically generated from SharePoint sources are not available to guest users in applications with SSO enabled.
- When creating the necessary Microsoft Entra ID application registration, you or your administrator must specify the scope
Sites.Read.Alland scopeFiles.Read.Allwithin the Microsoft Entra ID application registration. - Selecting "No authentication" means your agent cannot access information from SharePoint.
- When you configure authentication, scopes control user access. Specify
Sites.Read.AllandFiles.Read.Allin the scope field valuesprofilethatopenidare already present in Copilot Studio. These scopes do not grant users higher privileges when using the agent, but allow them to access permitted content from the SharePoint site as configured for automatically generated responses. - SharePoint supports setting up authentication manually with the following authentication service providers:
- Microsoft Entra ID
- Microsoft Entra ID V2 with linked credentials
- Microsoft Entra ID V2 with certificate
- Microsoft Entra ID V2 with client secret
- SharePoint does not support manual authentication using Generic OAuth.
- This configuration applies only to generated responses and not to Power Platform Connectors.
SharePoint source filtering
To improve the performance of your agent's SharePoint knowledge source, specify search query parameters. These query parameters define what is searched for within the knowledge source. For example, you might specify that you only want to search for items that have been modified in the last 6 months. Build this type of filter as follows:
| Attributes | Operator | Value |
|---|---|---|
Modified on |
on or after |
X date |
Create filtration conditions
After adding SharePoint knowledge sources, set up the search criteria.
1. On the Knowledge page , select your SharePoint source.
2. Select the three dots (…) for the SharePoint source and choose Edit .
3. Select Advanced settings .
4. Build filters to include or exclude information from your SharePoint knowledge source. Base the filters on one of the following options:
- Title
- Author
- Edited by
- Modified into
5. Set the condition value to one of the following values:
- A static value
- An input variable provided by the user during the chat with the agent is then stored as a custom global variable.
- A system variable
6. Select Save when you have finished configuring the filter.
Add settings to improve search
To filter your SharePoint sources, turn off the following settings:
- Web Search
- At the agent level, disable the "Use general knowledge" setting in the agent's Generative AI settings .
- At the topic level, disable the "Allow the AI to use its own general knowledge (preview)" setting in the Generative Answers node.
When you disable these settings, the agent will respond "no response" if it cannot find results in the filtered SharePoint knowledge source.
Use variables as URLs.
Use variables in the URL of a public website or SharePoint knowledge source to dynamically control the scope of content your agent uses.
Instead of creating multiple knowledge sources for different scenarios, define a single knowledge source and insert a variable into the URL. During runtime, Copilot Studio will resolve the variable and use the resulting URL as a basis.
Variable support
When adding or editing the URL of a public website or SharePoint knowledge source, you can insert a variable into the URL field.
Use variables to:
- Add the path to the base URL.
https://www.contoso.com/{variable} - Replace the entire URL
{variable}
When run, the variable will be resolved to a string value. The knowledge source is scoped to the resolved URL.
Note : Using the variable will change the URL used for linking. It does not change URL structure requirements or depth limits for public web pages.
Create and set variables
To use variables in a public website or SharePoint knowledge source:
1. Create a string variable with the scope Global .
2. Set the variable value using one of the following options:
- Topic input
- User profile attributes, such as language.
- Environmental variables
- Agent flow or connector
3. Insert a variable into the URL field by selecting {x} (Insert variable) .
4. Check the agent to confirm that the variable is resolved to the desired URL.
Example: Limiting the scope by product
You can limit the scope of knowledge to different product areas based on user queries.
1. Use the subject input field to store the product name as a variable named Product.
2. Add a Set variable value node after the Trigger node and create a new variable named ProductTable.
3. Use Power Fx formulas to define and map product names to URL paths.
Table( { Product: "Copilot", Path: "microsoft-365-copilot" }, { Product: "Teams", Path: "microsoft-teams" }, { Product: "Surface", Path: "surface" } )
4. Add a Set variable value node and use it to create a new global string variable named GlobalProductURL.
5. In the To value settings , select Formula and use the Power Fx function to perform a lookup in the table based on the value of the input variable Product, Topic.Product, as follows:
LookUp(Topic.ProductTable, Product = Topic.Product, Path)
6. Using variables in knowledge source URLs:
https://www.microsoft.com/en-us/{GlobalProductURL}
The agent only queries the limited scope of the webpage at runtime.
Common cases
Use variables in public website knowledge sources for:
- Product-based routing: Restrict queries to specific product documents.
- Filter by region or language: Map
User.Languageto localized URLs (e.g.en-us,it-it). - Environment-specific URLs: Switch between development, testing, and production websites.
Points to note
- Public website knowledge sources use Bing search and rely on indexed content.
- URL depth limits still apply when you use variables.
- Variables only change the destination URL. They do not affect how the content is indexed or retrieved.
Important note : This variable must point to a valid public URL that meets the requirements for knowledge sources on a public website. Invalid or unsupported URLs may not return results.
- Create and deploy agents in Microsoft Copilot Studio
- Add public websites as knowledge sources for agents in Copilot Studio.
- Add Dataverse tables as agent knowledge sources in Copilot Studio.
- Overview of Copilot Studio
- Overview of AI-based agent creation
- Evaluating agent performance in Microsoft Copilot Studio
- Upgrade to Copilot Studio Unified Authoring
- Should you choose Microsoft 365 Copilot or Copilot Studio to build your agent?