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 / PowerApps Gallery show...
Power Apps
Answered

PowerApps Gallery show user picture error

(0) ShareShare
ReportReport
Posted on by 85

Dear PApps Users,

 

I have an error which occurs while starting application:

KarCz_0-1691525435242.png

Office365Users.UserPhotoMetadata failed: The function 'UserPhotoMetadata' 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.
 
My function on Image looks like this:
 
If(
!IsBlank(ThisItem.'Expert Name'.Email),
If(
Office365Users.UserPhotoMetadata(ThisItem.'Expert Name'.Email).HasPhoto = true,
Office365Users.UserPhotoV2(ThisItem.'Expert Name'.Email),
'blank-person'
)
Could you explain me what's happening and how can I fix it? I googled it, but nothing's working.
 
Categories:
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @KarCz,

     

    At first sight I would also not expect a blank value error. Make sure that the function is not written anywhere else by leveraging the Power Apps Search pane.

     

    To avoid an error pop-up, you could give the following adjustment a try:

    If(
     !IsBlank(ThisItem.'Expert Name'.Email),
     If(
     //Check whether the user has a picture, default to false if an error occurs
     IfError(
     Office365Users.UserPhotoMetadata(ThisItem.'Expert Name'.Email).HasPhoto,
     false
     ),
     Office365Users.UserPhotoV2(ThisItem.'Expert Name'.Email),
     'blank-person'
     ),
     'blank-person'
    )

    However, as said - I would not expect any errors. 

     

    You may want to give the following a try:

    • Make sure the latest app version is published - should you test this in Play Mode
    • Should you test in Edit Mode: try saving, closing and reopening your app
    • Try to use a different browser or guest mode
    • Clear your browser cache

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • KarCz Profile Picture
    85 on at

    Thank you. It worked! I forgot that I'm expanding the window and have another image of expert. When I pasted your function in both Images it's working! 

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard