web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Copilot Studio - Bot Extensibility
Suggested answer

How to Dynamically Scope Copilot Agent Knowledge to a Specific SharePoint Folder

(2) ShareShare
ReportReport
Posted on by 10

Hi everyone,

I’ve implemented an SPFx web part that captures the clicked element (folder name) on a SharePoint page and passes it to a Copilot agent via query string. The Copilot agent reads this value and stores it as a global variable.

The agent uses a SharePoint document library as its knowledge source, which contains multiple folders and subfolders. My requirement is:

When the SPFx web part sends a folder name, I want the Copilot agent to restrict its knowledge scope to only that folder—so all responses should be based solely on documents within that folder.

I’m looking for a way to implement this with minimal customization. Ideally, I’d like to avoid re-indexing the entire library or creating separate agents per folder.

Has anyone tackled a similar scenario? What’s the best way to dynamically filter the knowledge base in Copilot based on a folder name passed from SPFx?

Thanks in advance!

Categories:
I have the same question (1)
  • Suggested answer
    Romain The Low-Code Bearded Bear Profile Picture
    1,155 Super User 2025 Season 2 on at
    How to Dynamically Scope Copilot Agent Knowledge to a Specific SharePoint Folder
    hello
     
    at my knowledge, using instruction to tell "use only this folder" as never worked.
     
    what i do "not dynamically" is that you can have a data source per folder in copilot studio : you can add a sharepoint libary with the folder in the url and it will target the url of the library, instead of full library, use this often to have good agent : not target full lib but use few topics to target folder.
     
    Doing this dynamically i m not sure it's possible :)
     
    hope this help

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Copilot Studio

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 506 Super User 2025 Season 2

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 387 Super User 2025 Season 2

#3
DAnny3211 Profile Picture

DAnny3211 132

Last 30 days Overall leaderboard

Featured topics