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 / use of environment var...
Power Apps
Answered

use of environment variables within PowerFX

(0) ShareShare
ReportReport
Posted on by 305
Hello,
 
I would like to ask if is it possible to use environment variable within PowerFX, i already used them within power automate but i did not manage to know how to use them within PowerFX and I did not find too much documentation on that matter too. if anyone know how to do it i would really appreaciate if he can give description of a simple demo.

Regards
Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
     
    Do you mean like in a Canvas App? then yes, but here are the Learns for each area.
     
     

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

    Thank you!
    Sincerely, Michael Gernaey
     
  • Verified answer
    Pstork1 Profile Picture
    69,127 Most Valuable Professional on at
    Environment variables are stored in Dataverse, so you can easily use Power FX and a Dataverse connection to look them up. But that will require a Premium license.  I usually just use a Power Automate flow to retrieve the values and return them to Power Apps, because in a flow they are surfaced with just a Standard License.  See @Michael E. Gernaey's links for additional information.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • kasraouiah Profile Picture
    305 on at
    Thank you @Pstork1 for your response i want to know that if only the app maker should have premium license or all users whom that i will share the application with should have premium license too
  • Pstork1 Profile Picture
    69,127 Most Valuable Professional on at
    @kasraouiah  Since it would add a Dataverse connector to the app to access the environment variable all users would need a premium license.  If you call a flow to access it then no one needs a premium license.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Michael E. Gernaey Profile Picture
    53,969 Moderator on at
     
    To add to what @Pstork1 said.
     
    While the question was only related to EV's, I would (if you hire me) actually look at what you are using EVs for. Many times using a configuration table in SharePoint (something you define in a list) is better
    1) You do not need a Premium license from the App
    2) You can make changes on the fly to any environment without having to redeploy for the changes to reflect (if you add more) etc.
     
    It also helps building dynamic configurations versus EVs. I use EVs as well in many situations, but depending on how many I will have, or the reason to access it, or the use, I will use SharePoint to create a configuration storage table to allow me to make instant changes to the values and have them show up, where I usually have a simple Admin UI (Canvas App) for it.
     
     
  • Pstork1 Profile Picture
    69,127 Most Valuable Professional on at
    @Michael E. Gernaey The two primary exceptions to that are the two main things I use environment variables for.
     
    1) SharePoint Site and List definitions. The environment variable makes it much easier and more foolproof to have separate sites and lists for Dev, Test, and Prod.
    2) Secrets - If I'm using secret keys to access Azure storage or a connector that needs a secret key I don't want those values readable in a SharePoint list or embedded in the app/flow. I want them in an encrypted storage that only the app/flow has access to.
     
    This becomes even more important if you are doing the work for a client where Prod is in a different tenant. I can use Environment variables without having to duplicate a SharePoint list to the other tenant since there is no easy way to duplicate the list.  Since I can retrieve the Environment variable with a short flow without a premium license I would rather do that then setup another SharePoint list.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Michael E. Gernaey Profile Picture
    53,969 Moderator on at
    Totally agree @Pstork1 :-) totally agree always exceptions or... what is a good phrase, reasons to do it one way or the other either all the time, or most of the time, that's why I like to understand why the person wants an answer to a question as it can depend.

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