In Dynamics 365 power app, I have a dataverse dataflow that uses power query to connect to a dataverse table. All works fine in dev, however everytime we deploy to another environment we have to manually update the datasource. Is there a way to use an environment variable e.g. in the following line in dataflow advanced editor..
E.g. I want to be able to do something like this..
Many thanks
You've hit upon a very common and frustrating challenge when deploying Dataverse dataflows across environments: the need to manually update data source URLs. Unfortunately, direct use of environment variables within the Power Query M code of a Dataverse dataflow is not directly supported in the way you've described.
The CommonDataService.Database()
function expects a literal string for the server URL, and it doesn't have a built-in mechanism to interpret environment variables.
However, there are effective workarounds that allow you to achieve the desired dynamic behavior:
1. Parameterized Dataflows with Power Automate (Recommended)
SiteUrl
).Source
step to use the parameter.SiteUrl
) with the appropriate URL value.SiteUrl
parameter.2. Configuration Table in Dataverse (Slightly More Complex)
EnvironmentConfiguration
) with a text column to store the URL.Source
step.3. Deployment Pipeline with Parameter Replacement (Advanced)
__SITE_URL__
).Recommendation:
Important Notes:
By implementing one of these workarounds, you can achieve dynamic data source URLs in your Dataverse dataflows, eliminating the need for manual updates during deployments.
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
106
Most Valuable Professional
Eugen Podkorytov
95