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

Community site session details

Session Id :
Power Apps - Power Apps Experimental Features
Answered

use of environment variables within PowerFX

(0) ShareShare
ReportReport
Posted on by 303
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
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    50,271 Super User 2025 Season 2 on at
    use of environment variables within PowerFX
     
    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
    68,236 Most Valuable Professional on at
    use of environment variables within PowerFX
    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
    303 on at
    use of environment variables within PowerFX
    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
    68,236 Most Valuable Professional on at
    use of environment variables within PowerFX
    @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
    50,271 Super User 2025 Season 2 on at
    use of environment variables within PowerFX
     
    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
    68,236 Most Valuable Professional on at
    use of environment variables within PowerFX
    @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
    50,271 Super User 2025 Season 2 on at
    use of environment variables within PowerFX
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 829 Most Valuable Professional

#2
developerAJ Profile Picture

developerAJ 489

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 395 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics