Introduction
One of the biggest strengths of Power Apps is its ability to deliver a personalized user experience. Instead of building one static app for everyone, Power Apps allows you to adapt the UI dynamically based on the logged-in user.
Using built-in functions like:
you can:
Create personalized dashboards
Auto-fill user details
Implement security trimming (role-based UI)
Improve usability and performance
In this article, we’ll explore how to use these functions effectively to build dynamic, user-aware Power Apps.
Understanding the User() Function
The User() function returns information about the currently logged-in user.Syntax
User()
Properties Returned
| Property | Description |
|---|
| User().FullName | User’s display name |
| User().Email | User’s email address |
| User().Image | User Profile Image |
Example
Label.Text = "Welcome " & User().FullName
2. Understanding the Office365Users Connector
The Office365Users connector retrieves detailed profile data from Microsoft Entra ID (Azure AD).
Commonly Used Functions
Office365Users.MyProfile()
Office365Users.UserProfile(User().Email)
Office365Users.Manager(User().Email)
Office365Users.DirectReports(User().Email)
Personalized Dashboards
Personalized dashboards show only relevant data to each user.
Example: Show User’s Assigned Records
Filter(
Projects,
AssignedTo.Email = User().Email
)
Each user sees only their projects, without creating multiple apps.
Role-Based Dashboard View
Assume:
If(
Office365Users.MyProfile().JobTitle = "Manager",
Projects,
Filter(Projects, CreatedBy.Email = User().Email)
)
5. Auto-Fill Logged-In User Information
Auto-Fill Name & Email in Forms
Set Default property:
User().FullName
User().Email
Auto-Fill Advanced Details
Office365Users.MyProfile().Department
7. Display User Profile Picture
Office365Users.UserPhoto(User().Email)
8. Security Trimming the UI (Role-Based Access)
Security trimming means hiding or disabling UI elements based on user role.
Hide Controls for Non-Admins
If(
User().Email in AdminEmails,
true,
false
)
Disable Buttons for Read-Only Users
If(
User().Email = Record.CreatedBy.Email,
DisplayMode.Edit,
DisplayMode.View
)
10 . Department-Based UI Control
If(
Office365Users.MyProfile().Department = "Finance",
true,
false
)
Example:
Conclusion
Using User() and Office365Users functions enables dynamic, intelligent, and secure Power Apps. From auto-filling user details to implementing role-based dashboards and UI security trimming, these functions are essential tools for building enterprise-ready apps.
When used correctly, they significantly improve:
User experience
Performance
Maintainability
Security awareness