cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PapithaSekar
Helper II
Helper II

Profile picture error

How to get profile picture from office 365 and get it displayed in power apps. I have connected office 365 user database and using share point list as data source. Am able to get user name, email id. but not able to get profile picture.

 

Used below formula in image property. If(Office365Users.UserPhotoMetadata(Office365Users.MyProfile().Id).HasPhoto,Office365Users.UserPhotoV2(Office365Users.MyProfile().Id),SampleImage) 

 

 

Getting attached error

3 REPLIES 3
JayMagness
Super User
Super User

 

I actually just did this today...

 

User().Image

 

This is the formula I used...

 

if you need further send me a note at Jay@research-Nest.com and I will got on teams with you and see if I can help you further,

 

Jay

 

 

profilepic_error.PNGI have tried, still facing errorbildeerror.PNG

Hi@PapithaSekar,

Based on the issue that you mentioned, do you want to display an office365 profile picture in PowerApps?

If you just want to display your own profile picture, put the formula as below into the Image property.

Office365Users.UserPhoto(Office365Users.MyProfile().Id)

 

Combine that with your description, you want to display a profile picture based on users and check if they have a picture. Please check if the user has an ID or other unique key like Email.

Please try the following formula.

If(
    IsBlank(ThisItem.Id),
    'profilepic-generic-user',
    If(
       Not(UserDomain.Text = MyDomain),
       'profilepic-generic-user',
       (
        If(
            Office365Users.UserPhotoMetadata(ThisItem.Id).HasPhoto = true,
            Office365Users.UserPhoto(ThisItem.Id),
            'profilepic-generic-user')
           )
       )
   )

Also, you can check the following thread for reference:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Error-Office365Users-User-Photo/td-p/48522

https://toddbaginski.com/blog/how-to-display-office-365-user-profile-images-in-powerapps/

 

Best Regards,

Qi

Best Regards,
Qi

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,944)