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 Platform Community / Forums / Power Apps / An ERROR "Office365Use...
Power Apps
Answered

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,963 Moderator 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
    Microsoft Employee 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,963 Moderator 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 915

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 457

Last 30 days Overall leaderboard