Introduction
When working with user profile information in Power Apps, many developers use the following approach:
Office365Users.UserProfile(User().Email)
While this works in many cases, it may not always return the expected results because the Mail attribute and UserPrincipalName (UPN) can be different for some users.
A more reliable approach is:
Office365Users.UserProfile(User().EntraObjectID)
Understanding the Issue
In Microsoft Entra ID (Azure AD), a user can have:
Since User().Email may not always match the value expected by the Office 365 Users connector, profile retrieval can sometimes fail or return unexpected results.
Why Use EntraObjectID?
The Entra Object ID:
Is unique for every user.
Remains unchanged even if the email address changes.
Is not affected by Mail and UPN differences.
Provides a reliable way to identify users across Microsoft services.
Recommended Approach
Use the following formula:
Office365Users.UserProfile(User().EntraObjectID)
This ensures that the user profile is retrieved using the unique identifier assigned to the user in Microsoft Entra ID.
Benefits
Improved reliability
Better user identification
Reduced dependency on email addresses
Supports environments where Mail and UPN are different
Conclusion
Although User().Email is commonly used in Power Apps, User().EntraObjectID is a more robust and future-proof approach for retrieving user information. Whenever possible, use Entra Object ID as the primary identifier to avoid issues related to email aliases, email changes, and Mail/UPN mismatches.