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 / Retrieve Office365User...
Power Apps
Answered

Retrieve Office365User Email Addresses

(2) ShareShare
ReportReport
Posted on by 5,331 Moderator
I have Screen1, on which is TextInput_1 and Gallery_1.

TextInput_1 is being auto-populated with names from a
SharePoint List based on choices made elsewhere.

I would like the Gallery_1 Label to auto-populate the email
addresses (from Office365Users) associated with the names
in TextInput_1.

I have tried the following in the Gallery_1 Label, but I'm getting
an error.

What am I missing?
 
LookUp(Office365Users.SearchUser({searchTerm:(TextInput3_1.Text)})
 
Categories:
I have the same question (0)
  • Suggested answer
    Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at
    Hey @Phineas
     
    Your LookUp is still open and has no arguments. 
    You xould also need to add a ".value" after the Office365Users function so that you get the table with the top 5 records. 
    To display it you should put it in a Gallery or look add a .Mail to it
     
    this would be what you are trying to get: 
    Office365Users.SearchUser({searchTerm:(TextInput3_1.Text)}).value // Returns top 5 results
    
    //get first result and display only the mail
    First(Office365Users.SearchUser({searchTerm:(TextInput3_1.Text)}).value).Mail
     

    If this solved your problem, please mark it as Solved to help others find the solution faster.
    If you found it helpful, consider giving it a Like to support each other in this community!

    Thanks, and happy building!

  • Verified answer
    BD-01080338-0 Profile Picture
    44 on at
    There will be at least two names in the TextInput field.
     
    Does this change the formula?
  • Phineas Profile Picture
    5,331 Moderator on at
    I got the following to work.

    If I use User().FullName or hardcode my name into TextInput3_1.Text, the Gallery displays my email address.



    However, if I try to use the following there are no results.

    There are times when there may be one name returned, or two or more names returned to TextInput3_1.Text.

    How do I update the formula so that the email addresses associated with the names in TextInput3_1.Text appear in the Gallery?

    TextInput3_1.Text = (the property dropdown is on another screen)
    LookUp(WRApprovalsCollection,HOA = Property_Dropdown.Selected.HOA,Title &", "& User().FullName )

    Gallery Items = Office365Users.SearchUser({searchTerm:(TextInput3_1.Text)})

    Gallery Email Address Label = ThisItem.Mail
     
  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at
    Hey @Phineas
     
    Whta Happens if you only tipe in Curtis? 
    Still no answers? 
     
    Let me know what happens afterwards we tackle the next issue
  • BD-01080338-0 Profile Picture
    44 on at
    When I type Curtis I get my email address returned to the Gallery.
     
    However, if I type in John Smith (comma or semi-colin) Curtis (and my last name), no email appears in the Gallery.
     
    I am trying to create a formula that returns all emails for all names entered into the TextInput.
  • Suggested answer
    Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at
    To do that you would have to change the formula quite a bit. 
     
    You would need to do somehting like this: 
    //OnChange or on a button select after entering the names
    Set(varNames,Split(TextInput3_1.Text, "; "))
    //the initial formula shold be changed like this 
    ForAll(varNames, 
       First(Office365Users.SearchUser({searchTerm:(ThisRecord.Value)}).value).Mail)
    Let me know how this worked. 

    If this solved your problem, please mark it as Solved to help others find the solution faster.
    If you found it helpful, consider giving it a Like to support each other in this community!

    Thanks, and happy building!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard