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 Apps
Unanswered

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:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 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,505 Super User 2025 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,505 Super User 2025 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

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard