Skip to main content
Community site session details

Community site session details

Session Id : PvpIhSM4R3OzsJDu1gr67C
Power Apps - Building Power Apps
Answered

How to read Environment Variables in PowerApp?

Like (2) ShareShare
ReportReport
Posted on 30 May 2020 13:54:38 by 167

I'm looking for a quick example of how to read an Environment Variable in a PowerApp. https://docs.microsoft.com/en-gb/powerapps/maker/common-data-service/environmentvariables

 

I've set the variable in my environment. How do I simply read that in a PowerApp and display the current value in a text label?

  • Power_Person Profile Picture
    71 on 27 May 2024 at 17:59:04
    Re: How to read Environment Variables in PowerApp?

    For me somehow the 'Environment Variable Values'-table was not showing all my environment variables.
    I ended up only using the 'Environment Variable Definitions'-table with the same result:

    LookUp('Environment Variable Definitions'; 'Schema Name'="MySchemaName").'Default Value').value

     

    ( I am also using the european version of Power Apps with semicolon instead of comma. )

    It might help somebody facing the same issue like me.

  • pjdiii Profile Picture
    30 on 15 Nov 2023 at 14:49:02
    Re: How to read Environment Variables in PowerApp?

    A good indication of this issue 1) IntelliSense  will not bring up .'Schema Name'; 2) you'll receive an error on the compare 'Schema Name' = "myEnvVarSchemaName"

  • AG-20121725-0 Profile Picture
    44 on 31 Jan 2022 at 00:36:50
    Re: How to read Environment Variables in PowerApp?

    I made the mistake of adding both entities 'Environment Variable Values' and 'Environment Variable Definitions' to my app.  Editor was autocompleting to 'Environment Variable Definitions' and I didn't realize that 'Environment Variable Values' has a record field called 'Environment Variable Definition'.....

     

    LookUp('Environment Variable Values','Environment Variable Definition'.'Schema Name' = "myEnvVarSchemaName").Value //CORRECT
    
    LookUp('Environment Variable Values','Environment Variable Definitions'.'Schema Name' = "myEnvVarSchemaName").Value //INCORRECT

     

    Hope this helps anyone else who makes the same mistake.

  • AG-20121725-0 Profile Picture
    44 on 31 Jan 2022 at 00:20:41
    Re: How to read Environment Variables in PowerApp?

    Has anything changed since this post was answered?

    I have a simple text Environment Variable in my solution I'm trying to read in my canvas app but the formula from this post is not working.  Am I missing anything?

  • KrishnaV Profile Picture
    5,023 on 31 May 2020 at 15:41:14
    Re: How to read Environment Variables in PowerApp?

    Hi @DavePotts_BritE,

     

    I just noticed you liked my reply, please mark it as the solution if that solves your issue if not please let me know what else you need so that we can help the new members in the community also 😊

     

    Regards,
    Krishna


    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • Verified answer
    DavePotts_BritE Profile Picture
    167 on 31 May 2020 at 15:40:36
    Re: How to read Environment Variables in PowerApp?

    That's the pointer I needed. Thanks.

     

    The solution to my problem was to set the text on the label to be:

     

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

     

  • KrishnaV Profile Picture
    5,023 on 30 May 2020 at 15:12:03
    Re: How to read Environment Variables in PowerApp?

    Hi @DavePotts_BritE ,

     

    Have a look at this detailed video to help you better.

    https://www.youtube.com/watch?v=DxjwpqcwI_Y

     

    I hope this resolved your issue if you see any challenge let me know I am always happy to help.

     

    Regards,

    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete