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 / An ERROR "Office365Use...
Power Apps
Unanswered

An ERROR "Office365Users.UserProfile failed: The function 'UserProfile' has an invalid value for parameter 'userId' - a blank value was passed to it where it was not expected. Please make sure that a valid argument is passed to the function."

(0) ShareShare
ReportReport
Posted on by 6

I am trying to create my organization chart and do not know how to get rid off of this error. I tried few solutions from here but didn't work for me. 

I set the variable: 

WicherekXO_0-1695218393899.png

and also Office365Users.UserProfile(varcurrentuser)

and ThisItem.DisplayName and Office365Users.UserPhoto(varcurrentuser) 

 

For other people I used: Office365Users.UserProfile("xxxxx@xx.com") and Office365Users.UserPhoto("xxxxx@xx.com")

 

Have no idea where is the error and I this is my first app. If you want to help me I will appreciate detailed answer! 🙂 

Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    Hello,

     

    Hi, can you verify that varcurrentuser has an actual value? Since it thinks its null/blank.

    Can you also try 

     

    Office365Users.MyProfile().Mail 

    Office 365Users.DirectReports(Office365Users.MyProfile().Mail))

    // please try these separately or in the same button. Just to see if they work.
    Office365Users.MyProfile().Mail; 
    
    Office 365Users.DirectReports(Office365Users.MyProfile().Mail));


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi @WicherekXO,

    It is a common issue.

    You need to check as below:

    If(IsBlank(varcurrentuser),Office365Users.UserProfile(User().Email),Office365Users.UserProfile(varcurrentuser))
  • Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    I think the issue is, and I did ask them to check that, is why would it be blank, not just check it for blank. If its always blank its a bug. 

  • WicherekXO Profile Picture
    6 on at

    Hi, I have tried Office365Users.UserProfile(User().Email) and also for the UserPhoto instead of varcurrentuser and it eliminated the error. The one above did not worked for me. 

    Thank you for support guys!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard