Pull Office 365 User Data in Power Apps (Simple Example)

2 min read
Share Bluesky LinkedIn Facebook Reddit
On this page
  1. Pull Office 365 User Data into Power Apps
  2. Why This Is Useful
  3. Add the Office 365 Users Connector
  4. Get the Current User
  5. Get More Profile Information
  6. Get a User’s Manager
  7. Get a User’s Manager
  8. Performance Tip
  9. Final Thoughts
  10. Reduce manual data maintenance

Pull Office 365 User Data into Power Apps

One problem I ran into early when building Power Apps was working with user information.

Things like:

  • Who is the current user?
  • What department are they in?
  • Who is their manager?

At first I handled this the wrong way — manually storing user data in lists or tables. That works for small demos, but it quickly becomes messy in real apps.

A better approach is using the Office 365 Users connector, which pulls user information directly from Microsoft 365.


Why This Is Useful

User data shows up in a lot of apps:

  • approval workflows
  • assigning records
  • sending emails
  • filtering data by user

Instead of maintaining a separate user list, you can pull the data directly from your organization’s directory.


Add the Office 365 Users Connector

In Power Apps Studio:

  1. Open Data
  2. Click Add data
  3. Search for Office 365 Users
  4. Add the connector

Once it’s added, you can start using it in formulas.


Get the Current User

Power Apps already provides a simple function:

User().FullName User().Email User().Image

For many apps, this is all you need.

Get More Profile Information

The Office 365 Users connector lets you retrieve additional profile data.

Office365Users.MyProfile()

Examples:

Office365Users.MyProfile().DisplayName Office365Users.MyProfile().JobTitle Office365Users.MyProfile().Department Office365Users.MyProfile().Mail

This lets you display things like job title or department inside your app.

Get a User’s Manager

This is especially useful for approval apps.

Office365Users.Manager(User().Email).DisplayName

Get a User’s Manager

This is especially useful for approval apps.

Office365Users.Manager(User().Email).DisplayName

Or retrieve their email:

Office365Users.Manager(User().Email).Mail

Now approvals can automatically route to the correct manager.

Performance Tip

Avoid calling the connector repeatedly across many controls.

Instead store the profile in a variable when the app loads:

Set(varUserProfile, Office365Users.MyProfile())

Then reference the variable:

varUserProfile.DisplayName varUserProfile.Department varUserProfile.JobTitle

This keeps your app faster and formulas cleaner.

Final Thoughts

When I first started working with Power Apps, I didn’t realize how much useful data was already available through Microsoft 365 connectors.

Using the Office 365 Users connector makes it easy to:

  • retrieve user profiles
  • find managers
  • personalize apps

Reduce manual data maintenance

If you're building internal business apps, this connector quickly becomes one of the most useful tools in Power Apps.

I’m currently documenting my Power Platform learning journey and sharing what I learn while building real apps.

Originally posted on DEV.to.

Found this useful?

Bluesky LinkedIn Facebook Reddit

More examples on the Code page. Questions about a snippet? Say hello.

More from the journal in Power Platform

All posts →

Comments

No comments yet. ASCII, code, and plain punctuation are welcome.

Leave a comment

Your email stays private. It is only used if you ask for reply notices. Required fields are marked required.

Tip: **bold**, _italic_, `code`, [text](https://), and > quotes. ASCII punctuation is kept as typed. 0 / 8000

This site uses Akismet to reduce spam. Learn how your comment data is processed.