Building and customizing solutions using Microsoft 365 Copilot APIs and tools
Variable knowledge source URLs in Copilot Studio are supported, but the behavior described (the URL changing from an interpolated/Formula form to a literal string when adding a filter) isn’t documented as configurable behavior. The supported and documented pattern is:
- Create a string variable with Global scope.
- Set its value via topic inputs, user profile, environment variables, or flows/connectors.
- Insert that variable into the knowledge source URL using {x} (Insert variable) so that at runtime the URL is resolved and used for grounding.
- Optionally, use Power Fx formulas to map inputs (for example, product names) to URL paths, and then use the resulting global variable in the URL, such as:
https://www.microsoft.com/en-us/{GlobalProductURL}
This mechanism is explicitly supported for both public website and SharePoint knowledge sources and is what ensures that the variable is resolved at runtime rather than treated as a literal string.
The documentation does not describe any supported way to alter or override how the URL is stored or interpreted once additional configuration (such as filters) is applied, nor does it describe a UI path to revert a URL that has been converted from a variable expression to a literal string. The only documented and supported approach is to:
- Keep using a Global string variable for the URL.
- Insert it via Insert variable in the URL field.
- Ensure the variable resolves to a valid URL that meets the knowledge source requirements.
Given that adding a filter causes the URL to be treated as a literal string and this cannot be reversed in the UI, this behavior is not covered as configurable in the available documentation and should be treated as a product issue/bug rather than something that can be fixed through supported configuration alone.
The practical next step is to keep the variable-based setup as documented and open a support case or feedback ticket for Copilot Studio so the product team can address the behavior where adding filters changes the URL from a variable expression to a literal string.
References:
- Add SharePoint as a knowledge source
- Add a public website as a knowledge source
- Use SharePoint content for generative answers
- Unstructured data as a knowledge source
- Copilot Studio Agent doesn't recognize the docs in the Knowledge Base. - Microsoft Q&A
- Copilot Studio Agent will not read entire data set in Excel or markdown - Microsoft Q&A
- Copilot Rewrite Feature not working in Classic Outlook - Microsoft Q&A
- Why did MS Learn delete whatever I was trying to view? - Microsoft Q&A
- Can't post questions for no reason. - Microsoft Q&A