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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Set up a Dataflow with...
Power Apps
Suggested Answer

Set up a Dataflow with an environment variable to set the env URL when pushing a solution from Dev

(0) ShareShare
ReportReport
Posted on by 20
I have several dataflows built in Power Apps that reference details in Dataverse tables, and require the Dataverse environment URL. When I push my solutions from Def to Test and then to Prod, I have to go into each one and update the URL every time I update the solution. I have an environment variable set up that I can use for this purpose, and created a parameter in the dataflow, but I can't seem to figure out how to link them. It seems this used to be possible in the classic editor, but no longer seems available. ChatGPT has not been able to help me solve this one, so I am appealing to the guru's of the community for help on this!  
 
What is the correct way to set this up so the environment reference in my Dataflows is automatically updated when I push my solutions?
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at
     
    To clarify one thing, are you using Pipelines and Managed Environments? You did not say and when you use words like "push" I assume but I need to know for sure.
     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at
     
    Sorry its late I clicked to answer too fast before I was done.
     
    So, you hopefully have the dataflow in the solution, the same one as your environment variable.
    You have to create the parameter in Power Query (for the data flow itself), and use the Peek Code feature to find the correct environment variable reference so its assigned to that property.
    1. Make sure you have your deployment settings JSON File so that it will map the environment variable to the correct environment. 
    2. Once you have that, as part of the Pipeline Import, the Import Solution Task has to be configured as such
      • UseDeploymentSettingsFile: true
      • DeploymentSettingsFile: fullpathtothenew/settings.json
    Do you need help with building the json? or setting those values?

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • EricArcher33 Profile Picture
    20 on at
    Thanks for the replies Michael.
     
    To answer your first question yes I am using Pipelines with managed environments.
     
    I have created a parameter called EnvironmentURL, and for now I have it set up to use a list of values that I select for each environment after pushing the solution update. Because there are no applied steps in a parameter there is no "Peek Code" to access, but I can open the advanced editor to see the M code. I believe I will need to change the suggested values from "List of Values" to "Any Value" or "Query" but to use query I would first need to set up the query option. 
     
    Can you tell me more about the deployment settings JSON file? Where I find it, or do I have to create it?
     
    I have the Environment Variable env_EnvironmentID set up in the solution pipeline so it sets the correct environment URL.
     
    What I can't figure out how to do is get my dataflow to read that environment variable. I can't find a way to configure the parameter to access it.
     
     
    I can't believe it is this difficult to set up a dataflow to read in the correct environment on a system designed to design, test, and implement in separate environments. There has to be an easier way!
     
    Thanks again for your help on this and for any further guidance you can provide.
  • Michael E. Gernaey Profile Picture
    53,433 Super User 2025 Season 2 on at
     
    I will come back Eric, I am on a small lol break at Disney Halloween Party so I wanted to let you know I will respond when I get back home on Monday so you dont think I just forgot

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard