web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / User().email is not th...
Power Apps
Answered

User().email is not the UPN for Guest Users

(2) ShareShare
ReportReport
Posted on by 87
we having guest account accessing our app and reported issue. we pinpointed the issue that we cannot use User().email to build SharePoint claims.
the workaround is the following code, noting that not every column that is returned by myProfileV2() is accessible to guest users so you have to use select for available columns for them or you will get 401 error.
 
Lower(Office365Users.MyProfileV2({'$select': "userPrincipalName, mail, displayName"}).userPrincipalName)
I have the same question (0)
  • Verified answer
    vipuljain03 Profile Picture
    657 Super User 2025 Season 2 on at
    This is a known limitation while handling guest users in Power Apps.
     
    For guest users, User().Email does not return the correct UPN (User Principal Name) or valid SharePoint claims identity. (SharePoint Claims format: i:0#.f|membership|someone@example.com)
     
    To retrieve the userPrincipalName for Guest Users, the code which you have used is correct. 
    By explicitly requesting just the accessible fields (userPrincipalName, mail, displayName) using $select, you not only avoid 401 Unauthorized errors from restricted properties, but also ensure compatibility across user types including guests.
    --------------------------------------------------------
    If this reply helped you, please mark this reply as suggested answer ✔️ and give it a like to help others in the community find the answer too!
    Thanks,
    Vipul

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard