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 / office365users return ...
Power Apps
Unanswered

office365users return email from user id

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a text input with employee user id. I would like to create a dropdown that feeds off of that text input and provides- me with that employees email address. How can I enhance the formula below to return the email attached to employee user id?

 

 

office365Users.SearchUser({searchTerm:DataCardValue14_2.Text,top:0})

Categories:
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Anonymous 

    The Office365Users connector has a function Office365Users.UserProfile which takes a user ID and returns their profile.

    You can extract the email from the profile by referring to the Mail property.

     

    First, you should modify the TextInput field to capture the UserID, and then use this UserID in the Office365Users.UserProfile function to fetch the profile of the User.

     

    After getting the UserProfile, you can fetch the email ID of the user.

     

    Here's an enhanced formula example to help you:

    If(
     IsBlank(DataCardValue14_2.Text),
     "",
     Office365Users.UserProfile(DataCardValue14_2.Text).Mail
    )

    In this formula, DataCardValue14_2.Text should contain the user ID.

     

    The If function checks whether the user ID input is empty, and if it is, it returns an empty string. If the input is not empty, it calls Office365Users.UserProfile to get the profile for the user ID, and then retrieves the Mail property from the profile, which contains the user's email address.

     

    Please replace DataCardValue14_2.Text with your TextInput field name where you are capturing UserID.

    Make sure to test this with your app and see if it's what you're looking for @Anonymous 

  • elseb Profile Picture
    774 Moderator on at

    Hi,

    you can add below code to formulas property of your app:

    colProfiles = Office365Users.SearchUserV2({searchTerm:TXTprofilesearch.Text, top:30}).value;

     

    then add a text input name it: TXTprofilesearch

    and add dropdown with items set to colProfiles and set value property in the right panel to Mail.

     

    if you do above you will have first 30 emails of people that name start with whatever you put in that text input.

     

    Seb

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard