Environment variables in Canvas Apps

Published at Sep 17, 2025

#PowerApps #EnvironmentVariables 

Table of contents

What are Environment Variables?

Environment variables are a way to store and manage configuration data that can be reused across apps, flows, and other components within a Dataverse environment. They help make your solutions more portable, maintainable, and scalable.

As an example, you might be storing your files in Azure Blob storage. You would want to have separate containers for development and production. You would then use an environment variable to tell the app which container to communicate with, depending on whether it’s in development or production.

Licensing

Environment variables are stored in Dataverse. There was talk about them potentially being available without needing to query Dataverse, but nothing has come to fruition from that. As such, directly accessing environment variables in your canvas app will force the designation to be premium.

You can use environment variables for your SharePoint sites and lists/libraries and maintain the standard license designation, as these are imported into your app with the Power Apps engine communicating on your behalf. When connecting to SharePoint choose Advanced to be able to use an environment variable.

SharePoint environment variable

Creating an environment variable

As a best practice, always use solutions in Power Platform. From within your solution, you can create a new environment variable.

Create environment variable from solution

You will be able to choose from multiple data types. What you choose will depend on what you want to achieve. If you’re looking to connect to a SharePoint list or library, you’ll want 2 environment variables. The first one will contain the SharePoint site, and the second one will contain the list or library.

New environment variable form

Accessing environment variables from Power Apps

In order to directly call an environment variable, the first thing you will need to do is add the Dataverse tables to your app. They are called Environment Variable Values and Environment Variable Definitions. As you can probably gather, one table contains the definitions and the other contains the values.

Environment variable Dataverse tables

To query your environment variable you will need to reference the Schema Name. You could reference it using the Display Name, but this might change, whereas the schema name will not.

LookUp('Environment Variable Values', 'Environment Variable Definition'.'Schema Name' = "csex_InDevelopment").Value

You can find the schema name by looking at the environment variable in your solution.

Environment variable schema name

That’s it! You’re ready to start using Environment Variables in Canvas Apps. If you’re regularly referencing an environment variable, I would recommend using a named formula for it, so that the Power Apps engine can decide when to call it and cache it.

Environment variable called from a canvas app