In this blog post we will learn how PowerApps get current user (ID, Email, Name,Picture, Manager, language, ….
PowerApps get current user Details
In Power Apps you can get the Current user details using the User() function and the Office365Users connection.
User function in PowerApps
You can use PowerApps User() function to get the FullName, Email and the Image of the Current logged in user
PowerApps user function Syntax
User()
PowerApps get current user Full name
User().FullName
PowerApps get current user Email
User().Email
PowerApps get current user Image
User().Image
Use office365users Connector
The second option in PowerApps to get more details about the user is by using office365users connection.
- Connect the Office 365 Users to Your app.
- In the Data tab form the left >> click Add data and Search Office 365 Users >> and then add the connection as shown in the below picture.
Now you can use office365users connector to get current user information
PowerApps office365users get user by email
You can use Office365Users.UserProfile or Office365Users.UserProfileV2 that get more information about the user using the user email.
PowerApps get current user display name
Office365Users.UserProfile(User().Email).DisplayName
PowerApps get current user id
Office365Users.UserProfile(User().Email).Id
PowerApps get current user Department
Office365Users.UserProfile(User().Email).Department
PowerApps get current user location
Office365Users.UserProfile(User().Email).OfficeLocation
PowerApps get Logged in user job title
Office365Users.UserProfile(User().Email).JobTitle
You can get all of this properties “
id, displayName, givenName, surname, mail, mailNickname, accountEnabled, userPrincipalName, department, jobTitle, mobilePhone, businessPhones, city, companyName, country, officeLocation, postalCode
.”
PowerApps get current user Manager
Office365Users.ManagerV2(User().Email).mail
You can get the other properties of the current user manager using the above concept, just change the mail property to the property you want to retrieve.
Powerapps get user information
You can get the details of any user by using the USerProfile function an pass the User Email to it as shown below.
Office365Users.UserProfile(userEmail).City
Office365Users.UserProfile(userEmail).CompanyName
Office365Users.UserProfile(userEmail).Country
Office365Users.UserProfile(userEmail).Department
Office365Users.UserProfile(userEmail).DisplayName
Office365Users.UserProfile(userEmail).GivenName
Office365Users.UserProfile(userEmail).Id
Office365Users.UserProfile(userEmail).JobTitle
Office365Users.UserProfile(userEmail).Mail
Office365Users.UserProfile(userEmail).MailNickname
Office365Users.UserProfile(userEmail).mobilePhone
Office365Users.UserProfile(userEmail).OfficeLocation
Office365Users.UserProfile(userEmail).PostalCode
Office365Users.UserProfile(userEmail).Surname
Office365Users.UserProfile(userEmail).TelephoneNumber
Office365Users.UserProfile(userEmail).UserPrincipalName
Office365Users.UserProfile(userEmail).AccountEnabled
Office365Users.UserProfile(userEmail).BusinessPhones
See Also
- Power Apps Embed Canvas App In Model Driven App Form
- How To Share Model Driven App To Internal And External Users In Power Apps?
- How To Make PowerApps Work Offline?
- PowerApps Container Control Best Practice
- How PowerApps Patch Collection?
- PowerApps Patch Function Uses And Examples
- PowerApps Print Function, Forms, And Scrollable Galleries
- PowerApps Validation Examples On/before Submitting
- Share PowerApps With External Users / Guest Users
Join us
- Subscribe to Power Platform Geeks YouTube channel.
- Register to Saudi Arabia Power Platform User Group.
Need Help
- Have a related question? Please ask it at deBUG.to Community.