Accessing your Power Apps Environment Variables
Environment Variables allow you to define values that can be changed between different environments. This is especially helpful when deploying a Solution between Dev, Testing, and Production environments. The Environment Variables serve as a configuration for the solution, which can vary across different environments. This is how we can access those variables from our canvas Power Apps.
❗
This approach requires a Premium License!
Accessing Environment Variables directly from your Power Apps requires you to access Dataverse, which automatically makes your app require a Premium License.
Accessing Environment Variables directly from your Power Apps requires you to access Dataverse, which automatically makes your app require a Premium License.
Add an Environment Variable to your Solution
- Browse to your Solution.
- Select New > More > Environment Variable.
- Fill out the Panel with your details. For this example, I'm adding a simple text Data Type.
Add the variable to your Power App
- Edit your Canvas App.
- Open the Data panel and add the
Environment Variable Definitions
and theEnvironment Variable Values
data sources. - Add a text label to your screen.
- In the Text property of your label, update the Schema Name to the name of the variable you created (not the Display Name).
LookUp(
'Environment Variable Values',
'Environment Variable Definition'.'Schema Name' = "demo_DemoTextVariable",
Value
)
- Your label should now display the value you added to the Environment Variable!
Member discussion