Skip to content

Copilot Studio adding ?web=1 to any sharepoint site url #526

Description

@jeremyknight-me

What sample tool are you using?
SharePoint PDF Page Citations - https://github.com/microsoft/CopilotStudioSamples/tree/main/authoring/snippets/topics/sharepoint-pdf-page-citations

Describe the bug
Seems to be some post processing that is adding ?web=1 into all sharepoint.com links. This stops the direct page link from applying. Here's an example: https://*.sharepoint.com/sites/.../file.pdf?web=1#page=5. Seems to apply to both SharePoint and Dataverse backed Sharepoint.

To Reproduce
Steps to reproduce the behavior:

  1. Follow instructions for sample
  2. Test with any PDF

Expected behavior
No ?web=1 in the URL. Especially for PDFs

Screenshots
See below.

Additional context
I've only confirmed with *.sharepoint.com URLs.

I've tested with hard coded URLs in the topic. When any of our domains are hard coded into the topic, the ?web=1 does not get added.

I've also tried just writing out a SharePoint folder URL to the response and it still happens. Example: https://*.sharepoint.com/sites/.../Shared%20Documents/?web=1

Shows ?web=1 being added in SharePoint (including into the middle of a file name in certain situations):

Image

Shows not being added to non-SharePoint:

Image

I added this to the topic to test:

- kind: SendActivity
  id: sendActivity_plainUrlTest
  displayName: Send plain text test URL
  activity: |-
    Test SharePoint URL in code block:

    ```
    https://some.sharepoint.com/sites/Name/Shared%20Documents/document-260101.pdf
    ```

- kind: SendActivity
  id: sendActivity_plainUrlTestNoCodeBlock
  displayName: Send plain text test URL (no code block)
  activity: ="Test SharePoint URL: https://some.sharepoint.com/sites/Name/Shared%20Documents/document-260101.pdf"

- kind: SendActivity
  id: sendActivity_plainUrlTestBugNoCodeBlock
  displayName: Send plain text test URL (no code block)
  activity: ="Test SharePoint URL (potential bug): https://some.sharepoint.com/sites/Name/Shared%20Documents/document(2026.01.01).pdf"

- kind: SendActivity
  id: sendActivity_plainUrlTestNonSharepoint
  displayName: Send plain text test URL
  activity: |-
    Test Non-SharePoint URL in code block:

    ```
    https://some.domain.com/sites/Name/Shared%20Documents/document-260101.pdf
    ```

- kind: SendActivity
  id: sendActivity_plainUrlTestNonSharePointNoCodeBlock
  displayName: Send plain text test URL (no code block)
  activity: ="Test Non-SharePoint URL: https://some.domain.com/sites/Name/Shared%20Documents/document-260101.pdf"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions