Skip to content

Feature request: Runtime filtering/scoping for Generative Answers (uploaded files + SharePoint) by metadata (e.g., file name, category, tags) #451

@nurkmez2

Description

@nurkmez2

Title

Feature request: Runtime filtering/scoping for Generative Answers (uploaded files + SharePoint) by metadata (e.g., file name, category, tags)

Description

Is your feature request related to a problem? Please describe.
In Copilot Studio, Generative Answers can use knowledge from uploaded files (PDF/DOCX) and SharePoint sources. However, there is no reliable way to dynamically scope or filter the retrieval at runtime (per conversation turn) based on metadata such as category, file name, document ID, tags, or customer context.
This becomes a blocker for scenarios with hundreds/thousands of documents where users first select a category or where the bot determines a category via NLU and then should answer only from the relevant subset of documents.
Workarounds like adding “file name” into the search query are not deterministic and often return chunks from other documents. Creating separate static knowledge sources/scopes for every case (e.g., 1000 categories/doc groups) is not manageable.

Describe the solution you'd like
Add a runtime filtering/scoping capability for Generative Answers retrieval, for both:

  • Uploaded files (local uploads) and
  • SharePoint-based knowledge sources (optional)

Examples of desired capabilities:

  1. Metadata-based filter parameters (at runtime), e.g.:

    • fileName eq 'ABC-123.pdf'
    • category in ('IT', 'HR')
    • tags contains 'refund'
    • customerId eq 'C-1007'
  2. A way to attach metadata to uploaded files (or reuse existing metadata like file name) and then filter on it in the Generative Answers node.

  3. A Generative Answers node option like:

    • “Restrict retrieval to documents matching filter”
    • “Use only these document IDs / file names”
  4. Ideally usable via variables (Power Fx), e.g.:

    • FilterExpression = Global.SelectedCategory
    • AllowedFiles = Global.FileList

Describe alternatives you've considered

  • Embedding the file name into the user query (e.g., "ABC-123.pdf " + question) – improves relevance sometimes but is not reliable and not a true filter.
  • Creating many separate knowledge sources/scopes (one per folder/category) – not scalable for many categories/doc groups.
  • Using Azure AI Search with filterable metadata – works but adds significant operational overhead and complexity compared to built-in Generative Answers knowledge (indexing pipeline, schema, enrichment, etc.).
  • Custom Data input – requires extracting full text content externally; difficult for PDFs and defeats the benefit of built-in ingestion/indexing.

Additional context
Use case: Customer service agent selects a category (or the bot infers it). The answer must be grounded only in the documents for that category (e.g., “Returns Policy – EU”, “Warranty – Product X”, “Contract Type Y”). Documents are mostly PDFs; they may be uploaded directly to Copilot Studio or stored in SharePoint.
We need deterministic runtime filtering/scoping to avoid answers grounded from unrelated documents and to keep governance manageable.

References / related discussions

Power Platform Community: “Generative answers with filtering documents / knowledge bases”
https://community.powerplatform.com/forums/thread/details/?threadid=fedcdc55-5967-4293-8417-c163e99f440f

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions