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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Error message

(0) ShareShare
ReportReport
Posted on by 202

hi. I have a customized form. When the user opens the form on sharepoint, it would extract users details. 

 

I used this code for the managers hierarchy

Office365Users.ManagerV2(User().Email).mail - user manager

Office365Users.ManagerV2(Office365Users.ManagerV2(User().Email).mail).mail - manager of the users manager

Office365Users.ManagerV2(Office365Users.ManagerV2(Office365Users.ManagerV2(User().Email).mail).mail).mail - etc

 

It works. But one user have this error message and it doesnt work for him, im not quite sure why.

batmanMon_0-1674721072923.png

 

Categories:
  • BCBuizer Profile Picture
    22,895 Super User 2026 Season 2 on at

    Hi @batmanMon ,

     

    Perhaps someone's manager hasn't been set. This will cause the ManagerV2 function to return an error.

     

    I advise to add some error handling in your code, for instance with the IfError function: https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-iferror

  • batmanMon Profile Picture
    202 on at

    @BCBuizer thank you for your reply. The user works for the same manager for a couple of years now 😞 i dont know why he is the only one whos got this error message.

  • batmanMon Profile Picture
    202 on at

    The weird thing is, if I put a text label and type this specific users email address(lets call him Bob). then I inserted a second label with Office365Users.ManagerV2(Label2.Text).mail. it works, it recognizes Bobs manager.

    The form doesnt recognize Bobs office365 details, when he opens the app himself. It works perfect for any other user

    batmanMon_0-1674724890222.png

     

  • batmanMon Profile Picture
    202 on at

    I know now what was wrong. It appears that the user has two email addresses. I dont know how to go around it in smart way, so i hardcoded Bobs email addresses in if statement

  • BCBuizer Profile Picture
    22,895 Super User 2026 Season 2 on at

    Hi @batmanMon ,

     

    Instead of using User().Email you may opt to use Office365Users.MyProfileV2().userPrincipalName

  • Verified answer
    BCBuizer Profile Picture
    22,895 Super User 2026 Season 2 on at

    Hi @batmanMon ,

     

    Instead of using User().Email you may opt to use Office365Users.MyProfileV2().userPrincipalName

  • batmanMon Profile Picture
    202 on at

    @BCBuizer it worked! Thank you so much!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard