Quite often you need to have your app look and behave a bit differently depending on the current Environment context. I recently had to implement simple functionality where the user is directed to a Power BI report page on a click of a button. That’s simple enough using the Launch function in Power Apps, but in my case we were utlizing dev, test, and prod environments and the link used should target development, test, and production Power BI workspaces accordingly.
To solve this, I added a new Environment variable to the Solution.
I left Default Value blank and entered the URL to the Power BI report in the development workspace as the Current Value. I can then later update the Current Value in test and production Environments accordingly.
Next step is to edit your app so that you can access the new Environment variable. Go ahead and add Environment Variable Definitions and Environment Variable Values as data sources in your app.
After this, you can reference desired variable value like this:
LookUp(‘Environment Variable Values’, ‘Environment Variable Definition’.’Display Name’ = “Raportti URL”)
By using Environment Variables in your solution, you can easily separate environment specific details out of your app to a separately maintainable configuration location.