In powerapps, how do you populate a text box with data from a field in a record in a data table or data from table itself? It seems like it should be easy but it doesn't appear to be. I just want to populate a text box from a datatable or table, but I can't seem to find a solution to this.
Solved! Go to Solution.
You could try something like this:
Create a label. In properties, set Text to:
LookUp(datasource, name = "fred", namefield)
or to get the first row and attribute from table:
First(datasource).attribute
Sean
You need to select a single record from your db table first. This could be done by using a gallery to easily list the records and once a record is selected, use the gallery.selected.value to populate the text field.
Another route would be using a form. This form's source would be the gallery and therefore, a record view at a time. Each time you select a new record in your gallery the form and its fields will repopulate with the record you have selected.
You could try something like this:
Create a label. In properties, set Text to:
LookUp(datasource, name = "fred", namefield)
or to get the first row and attribute from table:
First(datasource).attribute
Sean
Great suggestion and it worked! Thanks for your help.
What was weird is that when i first put in the code, it indicated that there were errors in my entry. It seemed that there was a bit of a delay in it evaluating my text, and eventually it indicated my code (based on your recommendation) was correct.
I'm going to take a look at your solution. I tried the other one here and for my purposes it worked quite well. Your solution however seems more elegant and will work in other situations. I'm going to practice working with it and I think I'm going to hit a few places where your solution might be the bette way to go.
I love/hate working with brand new software!
I'm pretty new to PowerApps too. I've been working with it for the past 3 months. Just keep your eyes out on forums for others with similar issues if you run into trouble.
All the best!
Sean
I ran into that problem also, especially when the form opens for the first time. Still learning about efficient design in Powerapps
User | Count |
---|---|
253 | |
109 | |
92 | |
48 | |
37 |