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 Apps
Answered

Variable Question

(0) ShareShare
ReportReport
Posted on by 16

Ok I have a pretty simple question but I'm having a hard time finding or figuring it out.

I have a simple variable being created by :

Set(varPresident, Office365Users.SearchUser({searchTerm: "Paulk"}));
Now when I look under Variables I see that this variable is a table and hold all the data I'm trying to retrieve.
Now if I wanted to just put it to a simple label it will not take. I thought it would be just be putting this under the text attribute:
varPresident.Mail for the Mail column Data or say varPresident.displayName but this does not work.
If I create a variable like:
Set(varTest4,{label:"test", label2:"test2"})
I have no issues setting the text of the label with varTest4.label4 which would be test2 on the label. Why is this.
I thought even that I would need to put in varPresident[0].Mail but that also didn't work. I'm missing something here and I'm sure its pretty simple for someone that actually understands powerapps. This is only my 2nd day messing around with it so your patients is greatly appreciated.
CJStylez_0-1719703688762.png

 

Hope this makes sense.
Cheers
Chris
 
Categories:
I have the same question (0)
  • Verified answer
    AmínAA Profile Picture
    1,228 Moderator on at

    Greetings @CJStylez!

     

    The way you're saving that variable, is set up as a table, and as it is, you can't really call a specific record from a column like that . . . Bear in mind that 'your table'.'your column' calls the whole column, and even if it just haves one record, it would be an error for a label that expects a text datatype. You can try something like the following . . .

     

    Text property of Label

    First('YOUR TABLE NAME').'YOUR COLUMN NAME' //This is the generic formula
    
    First(varPresident).displayName //This is you specific use case

     

     

    Hopefully that's enough for you, otherwise, feel free to reply!

  • Verified answer
    WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    Hi @CJStylez ,

    Try

    Set(
     varPresident, 
     First(
     Office365Users.SearchUser(
     {searchTerm: "Paulk"}
     )
     )
    );

    then DisplayName with a capital D

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • CJStylez Profile Picture
    16 on at

    Thanks for the quick response. This makes total sense since its a table. I guess I really should of tried that.

    This worked exactly as intended and I learned a little more today.

    Much appreciated.

    Have a great night

  • CJStylez Profile Picture
    16 on at

    Thanks for both suggestions. They both worked for my needs. Much appreciated.

    Have a great weekend.

    Cheers

  • AmínAA Profile Picture
    1,228 Moderator on at

    You're welcome . . . Also, what I did allows you to use any of the other columns contained within the formula, however @WarrenBelz's way is better if you only need one field, since it's performing the operation before saving the variable!

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 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard