cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

VarDataFrom to get selected data from Gallery data

Hey Community, I used VarFromData in Item at Form Control and get data from gallery data successfully. But I do not understand why does this work, i stole the idea from some videos. I use gallerydata.selected to get selected data, but it has error. I have seen any source to explain VarFromData. It shows green color in the property, is there any document to explain the meaning of different colors of the function in PowerApps? Thanks experts in advance!!!

4 REPLIES 4
BCLS776
Super User
Super User

Power Apps will color controls, variables, and other defined terms to help with debugging and visualizing relationships.

 

Your VarFromData term is likely a variable defined by a Set() or UpdateContext() function. In the Studio, click on View and then Variables to see a list of them used/defined in your app. Click on the one labeled VarFromData and you'll where it shows up in your app.

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
Anonymous
Not applicable

Thanks sir, I just checked variables and i saw it there. Can we understand it as a reference? But I still confuse when shall i need to use it and what the purpose to use it? Sorry, i am a newbie in Powerapps!

 

BTW, is there any documents to explain all the color controls - from general sense, I think it will be very help to know the meaning of different colors when I use it more often. Sometimes, I just solved a single problem - but it is willing to deep understand this powerful tool!! Thanks again! 

Here's some info on the syntax colors in Power Apps. It is a handy feature that many code development studio apps use.

 

A variable is a reference to some data that you can use in your app. You can store and then later retrieve or alter the data to suit the app's purposes. Power Apps uses two main kinds of variables: Global variables that can be used across any screen, and context variables that only exist on the screen on which they are created.

 

Note, one of the strengths of Power Apps is that you don't have to use a lot of variables; much of the data can be accessed by referring to controls and their properties. For example, Label1.Text will bring along whatever string is stored in Label1's Text property. Another one, Gallery1.Selected, will give access to the currently-selected record from Gallery1. This helps make using controls and data a lot more intuitive.

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
Anonymous
Not applicable

Your explanation is very clear! PowerApps has made some function for us to retrieve data, but sometimes it does not work. I am not sure they, for instance, Gallerydata.Selected does not work in my scenario ( I assume it is bc my gallerydata item has search and filter, so selected cannot recognize it). Variables seems more powerful to refer to whatever we want to use again. I will do more research on that 2 types of variables - it is useful! In PowerBi, it uses reference query to intro this kind of technique. I do see people use variables in PQ, but i have not used it. It is interesting to different terms they introduce in different tools. Thanks for your patience and great answer!!! 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,060)