cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
arnav2109
Level: Powered On

Office365User.UserPhoto V2 and

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))

 

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Office365User.UserPhoto V2 and

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

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
arnav2109
Level: Powered On

Re: Office365User.UserPhoto V2 and

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
Level: Powered On

Re: Office365User.UserPhoto V2 and

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

 

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 364 members 5,645 guests
Please welcome our newest community members: