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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Environnement variable...
Power Apps
Unanswered

Environnement variable in Dataflow ?

(1) ShareShare
ReportReport
Posted on by 32

Hello,

 

Do you know if it's possible to use environment variable in a Power App Dataflow ? If yes, how can I achieve this ?

 

My main purpose, it's to automatically gather data from the right source depending on the environment.
Example : I have two environments, one DEV and one PROD, when I deploy DEV to PROD, I want that the source in my dataflow change accordingly.
For DEV, in my dataflow, source is :

 

CommonDataService.Database("orgxxxxxx33.crm4.dynamics.com")

 

For PROD, in my dataflow, source is :

 

CommonDataService.Database("orgxxxxxxa3.crm4.dynamics.com")

 

I want to replace the static value by an environment variable or any kind of stuff that can change dynamically the source depending on the environment.

 

Thanks for your help,

Categories:
I have the same question (0)
  • Kikoger Profile Picture
    221 on at

    Hi @MGuyot,

     

    I've been trying to find a way to do this or to somehow make the Dataflow environment aware, but have not been able to 😞 


    Would love to hear about any progress you make?

     

    Max

  • MGuyot Profile Picture
    32 on at

    Hello @Kikoger,

    Sorry, I wasn't able to find a way to make the Dataflow environment aware dynamically.

    I found a little workaround if you have multiple reference of your environment in your queries : I create a parameter where I put my environment identification "orgxxxxxxxx.crm4.dynamics.com" and I use this parameter in my queries. However, each time I publish a new version of my dataflow, I need to change the parameter to the correct environment identification.

  • fshaikh Profile Picture
    33 on at

    Hi @MGuyot ,

    If dataflow is part of a solution. Doing any kind of editing in dataflow, either parameter, or editing the environment url directly; will create an unmanaged solution layer. How to avoid that?

  • MGuyot Profile Picture
    32 on at

    Hi @fareehashaikh ,

    For my part, I can't edit the dataflow inside the solution, even within an unmanaged solution. Indeed, my dataflow is listed in my solution's objects, but to edit it, I have to go outside the solution to the dataflow tab :

    MGuyot_1-1716991536382.png

    There, I can edit my dataflow and even if I'm working on a managed solution, it doesn't create an unmanaged solution layer.

    I hope this will help you.

  • fshaikh Profile Picture
    33 on at

    Hi @MGuyot ,

    Thank you for clarification. It is happening with me in Dev environment (un managed solution) that I can add/create a dataflow in a solution. But it is created outside the solution. And if i want to edit it, it can be done outside as you said. 

     

    But I was a bit reluctant to deploy this to Test because what if I do update the connection outside, but still an unmanaged layer is created for solution. It will messup the solution architecture. So you are saying that it doesn't? Just asking for confirmation. 

     

     

  • MGuyot Profile Picture
    32 on at

    @fareehashaikh,

    Power app doesn't allow editing anything in a solution manager to avoid any problems, so if you're allowed to edit things, that means it shouldn't cause any problems.
    In my opinion, you can edit any dataflow because they're not directly “stored” in the solution layer but in the environment layer (i.e. the layer above). As they don't really belong to the solution, they're not managed by it, so they can't be labeled as "managed". As long as they are not managed, you can edit them without any reluctance.

  • fshaikh Profile Picture
    33 on at

    @MGuyot 

     

    Thanks. Make sense. 

  • westerdaled Profile Picture
    670 on at
     
     
    Yes I have thew same issue . You can't use the web api to say read an environment variable because the dataverse api endpoint is tied to the enviroment it is in.
     
    One suggestion is a custom connector to return the web api end point but this is going to need some parameter,  Oh don't bother trying to access EnvironmentVariableValue table records because MS has deliberately prevented you from doing this a dataverse power query...
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard