PowerApps - Office 365 Users Connector
Let’s explore how you can leverage the Office 365 Users connector in Power Apps to access user profiles and retrieve information. This connector allows you to interact with user data within your organization using your Office 365 account. Here are the steps:
Adding the Office 365 Users Connector:
- In Power Apps, go to the Connections tab.
- Search for Office 365 Users and add it as a connection.
- Sign in with your work account if prompted.
Using the Connection in Your App:
- Once the connection is added, you can perform various actions related to user profiles:
- Retrieve your own profile information (e.g., name, email, photo).
- Get details about other users (e.g., their department, job title, phone number).
- Access a user’s manager or direct reports.
- Once the connection is added, you can perform various actions related to user profiles:
Displaying User Information:
- You can use the Office 365 Users connector to show relevant user data in your app:
- For the Current User:
- Insert a label and set its Text property to any of the following formulas:
Office365Users.MyProfile().DisplayName
Office365Users.MyProfile().JobTitle
Office365Users.MyProfile().Mail
- …and more (see the full list in the documentation).
- Insert a label and set its Text property to any of the following formulas:
- For Another User:
- Add a text input control (e.g., a text box) and rename it (e.g., “InfoAbout”).
- Enter an email address of a user in your organization (e.g.,
yourName@yourCompany.com
). - Insert a label and set its Text property to any of the following formulas (using the email from the text input):
Office365Users.UserProfile(InfoAbout.Text).DisplayName
Office365Users.UserProfile(InfoAbout.Text).JobTitle
Office365Users.UserProfile(InfoAbout.Text).Mail
- …and more.
- For the Current User:
- You can use the Office 365 Users connector to show relevant user data in your app:
Remember to adjust the control names and expressions based on your specific use case. The Office 365 Users connector provides powerful capabilities for working with user data, whether it’s your own profile or information about others in your organization! 🚀
How to get the Direct Reports (Sub Ordinates) of a user by Office365Users connector:
Get the direct reportees information into a collection by using the below function.
ClearCollect(myTeam,Office365Users.DirectReports(Office365Users.UserProfileV2(User().Email).id))
Add Office365Users connector.
Use UserProfileV2 function to get the user id or principal name by passing the user email id as shown below:
Office365Users.UserProfileV2(User().Email).id
How to add a blank record to a collection?
ClearCollect(myTeam,Ungroup(Table({},{Value:Office365Users.DirectReports(Office365Users.UserProfileV2(User().Email).id)}),"Value"))
Post a Comment