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 / Office365Users.UserPho...
Power Apps
Unanswered

Office365Users.UserPhotoV2(Thisitem.mail) Error

(0) ShareShare
ReportReport
Posted on by 557

Does anyone know how to remedy this error - it seems this happens when there is no picture for the team member.  If there is a solution in which component would I put it - ?  would it be within the Image component?

 

picture.png

Categories:
  • gcmfaizan Profile Picture
    1,022 on at

    @joel914823 Although your formula looks fine, can you try to pass Primary Email as the user id.

    gcmfaizan_0-1693488750060.png

    here is some limitation while working with Office365Users.UserPhotoV2():

    • The Office365Users.UserPhotoV2() function works with users within your Office 365 environment. It requires proper authentication and permissions to access the user's profile photo.
    • The function returns a URL to the user's photo. The image control in Power Apps will automatically display the photo using this URL.
    • If a user doesn't have a profile photo, the function might return a default placeholder image.
    • Keep in mind that user profile photos might not be available for all users in your organization's directory.

     

    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

     

    Thanks!

     

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

    Hi @joel914823,

     

     Indeed this function returns an error if no valid mail address is provided. To handle that error, use the IfError function:

     

    IfError(Office365Users.UserPhotoV2(Thisitem.mail), SampleImage)
  • joel914823 Profile Picture
    557 on at

    @BCBuizer   thanks for the suggestion - I tried to enter this in, but it seems like there is an invalid argument, any ideas?  

    picture2.png

  • cdwhite Profile Picture
    1,069 Most Valuable Professional on at

    Hi @joel914823 

    To use the IfError function suggested by @BCBuizer , you need to enable the following Preview feature in Settings:

    cdwhite_1-1693492660859.png

    Preview features aren't recommended for production apps, however in my experience you can use the error one with confidence. More info here if you need it.

    Please try enabling that Preview feature to see if the IfError function then works for you.

    ------------------------------------------------------------------------------------------------------------------------------
    If I've answered your question, please mark your post as Solved. You can accept more than one post as a solution.

    If my response was a good one, please give it a Thumbs Up!

    Visit my blog: https://platformsofpower.net

  • joel914823 Profile Picture
    557 on at

    @BCBuizer @cdwhite Thank you both - I tried enabling the preview feature but now the picture doesn't load at all.  

  • joel914823 Profile Picture
    557 on at

    @gcmfaizan Thank you .  I tried this method but now it shows my picture (whomever is logged into the app) versus the user name of the item in the gallery.

  • gcmfaizan Profile Picture
    1,022 on at

    @joel914823 yes you are right User().Email means your email, that's why I asked you to pass the primary email of the selected user for example: ThisItem.PrimaryEmail, This column is only shown when you are using the Users table as a data source. 

    Alternatively, you can use the lookup function inside the Office365Users.UserPhotoV2():

    Office365Users.UserPhotoV2(LookUp(Users,'Primary Email' = ThisItem.Email).'Primary Email')

    Note: I'm assuming the column email already exists in your current gallery data source.

     

     

    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

     

    Thanks!

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 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard