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 / Getting Email address ...
Power Apps
Unanswered

Getting Email address using Office365 Connector

(0) ShareShare
ReportReport
Posted on by 40

Hey Everyone,

 

Im using a combobox and the office 365 connector to populate it so you can search for a username. The goal is/was to use that display name and then use the collect feature to input that users email address into  a sharepoint list. Its not working, when I submit it comes through as blank, and even trying to set a variable, its mentioning the Username1.Mail as a table and not a text field. 

 

What am I doing wrong here:

 

 

Office365Users.SearchUser({searchTerm:ProjectControllerCombo_1.SearchText}).DisplayName

 

 

Thats the one to search for the username. 

 

For the onselect for the next page to declare a global variable to get the email, I have this:

 

 

Set(ProjControllerEmail,First(Office365Users.SearchUser({searchTerm:ProjectControllerCombo_1.SearchText}).Mail));

 

 

 

 

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    Consider this:

    On your combobox:

    Office365Users.SearchUser({searchTerm:ComboBox2.SearchText}).DisplayName
     
    OnSelect of the Button:
    Set(ProjControllerEmail,Office365Users.SearchUser({searchTerm:ComboBox2.SearchText}))
     
    In your TextBox or what to save:
    LookUp(ProjControllerEmail,DisplayName=ComboBox2.Selected.DisplayName).Mail
    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
  • BCLS776 Profile Picture
    8,994 Moderator on at

    @pocketens wrote:

    Hey Everyone,

     

    Im using a combobox and the office 365 connector to populate it so you can search for a username. The goal is/was to use that display name and then use the collect feature to input that users email address into  a sharepoint list. Its not working, when I submit it comes through as blank, and even trying to set a variable, its mentioning the Username1.Mail as a table and not a text field. 

     

    What am I doing wrong here:

     

     

     

    Office365Users.SearchUser({searchTerm:ProjectControllerCombo_1.SearchText}).DisplayName

     

     


    Try this: 

     

    First(Office365Users.SearchUser({searchTerm:ProjectControllerCombo_1.SearchText}).value).DisplayName

     

     This connector returns a record called "value", which within this record is a table of all the possible matches from your search. Your code needs to access the "value" record, and then be able to deal with a table of more than one record within that.

     

    Similarly, your second statement should probably look more like:

     

    Set(ProjControllerEmail,
     First(Office365Users.SearchUser({searchTerm:ProjectControllerCombo_1.SearchText}).value).Mail
    );

     

    Hope that helps,

    Bryan

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

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard