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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / populate a text box fr...
Power Apps
Answered

populate a text box from a field in a record in a data table

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

Categories:
I have the same question (0)
  • PowerAppJammer Profile Picture
    19 on at

    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.

  • Verified answer
    bean Profile Picture
    568 on at

    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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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. 

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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! 

  • bean Profile Picture
    568 on at

    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

  • Delid4ve Profile Picture
    795 on at
    You'll run into the slowness sometimes.. some of my onselect formulas are 50 lines long and it can take around a minute to correct any errors and format/colour text correctly
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I ran into that problem also, especially when the form opens for the first time. Still learning about efficient design in Powerapps

  • Verified answer
    Delid4ve Profile Picture
    795 on at
    I found lookups to be especially slow on forms, I found the best way to deal with it was to load my data into a collection at startup, addcolumns to the collection with the new column formula set to the lookup, that way the data is there waiting and the form doesn't have to do the lookup each time it is loaded
  • Delid4ve Profile Picture
    795 on at
    For instance:
    Addcolumns(ClearCollect(collection name,datasource),"NewColumnName",Lookup(datasourceb,field=datasource.field,valueyouwant))
    Set your form data source to the collection and use patch to patch the datasource and collection together.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I made my first successfull collection and now am using it in my screen. And the diff between a lookup and a collection is like and day!

     Thanks to everybody who helped me along with this question.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard