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 / Office365User.UserPhot...
Power Apps
Unanswered

Office365User.UserPhoto V2 and

(0) ShareShare
ReportReport
Posted on by 16

We have gallery and in that gallery we are displaying user photo , most of the time it displays error "Office365Users.UserPhotoV2 failed. The Server returned http error with code 0. Below is my code to display photo based on ID. 

 

If(!IsBlank(ThisItem.Id),Office365Users.UserPhotoV2(ThisItem.Id))

 

 

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    on at

    Hi @arnav2109,

     

    Could you please share a bit more about the Gallery control within your app?

    Further, could you please show more details about the ID that you mentioned? Is it the email id (or User principal name) of the user?

     

    I assume that the ID that you mentioned is the email id of the user. I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:8.JPG

     

     

    Set the Items property of the Gallery control to following formula:

    Office365Users.SearchUser()

    Set the Image property of the Image control within the Gallery control to following formula:

    If(!IsBlank(ThisItem.Id),Office365Users.UserPhotoV2(ThisItem.Id))

     

    Please also take a try with the following formula:

    If(!IsBlank(ThisItem.Id),Office365Users.UserPhoto(ThisItem.Id))

    then check if the issue is solved.

     

    In addition, please also take a try to re-create a new connection to the Office365 Users connector within your app, then try it again to check if the issue still exists.

     

     

    Best regards,

    Kris

     

     

  • arnav2109 Profile Picture
    16 on at

    In the Gallery I am trying to display Direct reports of Manager along with Photo,to achieve this I am passing email ID of Manager and trying to get all direct reports using

     

    If(!IsBlank(Gallery6.Selected.Id),SortByColumns(Office365Users.DirectReports(Gallery6.Selected.Id),"GivenName",Ascending))

    Note: In gallery6 I have details of multiple Managers.

     

    As output of Direct Reports does not have Photo, I am using Office365Users.UserPhotoV2 to get photo information & for this I am using

    If(!IsBlank(ThisItem.Id),Office365Users.UserPhotoV2(ThisItem.Id))

    Note : I have tried Office365Users.UserPhoto as well and see same issue.

     

     

    I see first time and some time it works but most of the time i am seeing errror but data is displayed & sometimes error is displayed and data is not displayed , If I refresh it works fine again for first try and if try some more time it shows error.

     

    Kindly let me know if any other details are required.

     

  • Peter1234 Profile Picture
    on at

    I also have the same issue with UserPhotoV2: all pictures are always blank...

     

    Here is my code:

    If(IsBlank(ThisItem.Id);
     person;
     If('Office365-gebruikers'.UserPhotoMetadata(ThisItem.Id).HasPhoto = true;
     'Office365-gebruikers'.UserPhotoV2(ThisItem.Id);
     person) 
     ) 
     

    When I put User().Image I do get my own image but when I do the Office365User connector for my own profile it is blank. 

     

    BTW: The .HasPhoto method returns false all the time.

     

    At this point in time we are still using Exchange on Prem, we plan to move to the cloud later. If this is the reason then I wonder if there is a way to get the user photo of someone else in the same way as User().Image is dong it?

     

    Best regards,

     

    Peter

     

     

     

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