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

Notifications

Announcements

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,923 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard