cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DavePotts_BritE
Advocate IV
Advocate IV

How to read Environment Variables in PowerApp?

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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

 

View solution in original post

5 REPLIES 5
KrishnaV
Community Champion
Community Champion

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.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

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
Community Champion
Community Champion

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.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
sigmaNot
Helper I
Helper I

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?

sigmaNot
Helper I
Helper I

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.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,831)