cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gterracciano
Regular Visitor

UserPhoto BadGateway

Hi all,

I developed a simple PowerApps for the Employee Directory but I've issue regarding thumbinalPhoto,

when i search for a user i get the following error:

 

1.PNG

 

I used the following query in the image object:

 

2.jpg

 

i also try to use the v2:  Office365Users.UserPhotoV2(ThisItem.Id)

but i get the same error

 
does anyone have any ideas
Tnx in advance

 

4 REPLIES 4
v-qiaqi-msft
Community Support
Community Support

Hi @gterracciano,

Based on the issue that you mentioned, do you want to display the user photo?

Could you please share a bit more about the scenario?

Could you please make sure that every user that you want to display the user photo is in your own organization rather than a guest out of your tenant?

I think you should connect the Office365Users to your app.

In my scenario, I have an SP list as my data source.

If everyone in your list has the photo, please try to modify your formula as below:

If(
    !IsBlank(ThisItem.PersonField.Email),
    If(
        Office365Users.UserPhotoMetadata(ThisItem.PersonField.Email).HasPhoto = true,
        Office365Users.UserPhotoV2(ThisItem.PersonField.Email),
        SampleImage
    )
)

v-qiaqi-msft_0-1619060950726.png

Hope it could help.

Regards,

Qi

 

 

 

Best Regards,
Qi

Hi @v-qiaqi-msft 
thanks for your quick reply,

I'm trying to implement a simple employee search form as explained here:
http://randsnet.blogspot.com/2020/03/creating-company-directory-in-office.html

I found issue only for displaying userphoto in the respective box, I used Office365Users as a data source where all users have their respective photo viewable:
4.PNG

I tried your suggestion but I get the following error:
3.PNG

in accordance with docs (https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/screen-templates/people-screen-referenc...) I tried to use also this method:

If( !IsBlank( ThisItem.Id ) &&
'Office365Users'.UserPhotoMetadata( ThisItem.Id ).HasPhoto,
'Office365Users'.UserPhoto( ThisItem.Id )
)

but i've a new error:
5.PNG

do you have any other suggestions?

Hi @gterracciano,

Since you have connected to Office365 and use it as your data source, I think there is something different from the solution I provided before.

I have made a test for you and it works great.

v-qiaqi-msft_0-1619144769320.png

In addition, please consider turn on the "Formula-level error management" option within Advanced settings of App settings of your app, then re-published your app, check if the issue is solved.

v-qiaqi-msft_2-1619145137999.png

Check if it helps.

Regards,

Qi

 

 

Best Regards,
Qi

hi @v-qiaqi-msft 

 

the solution doesn't work but I want to explain my scenario:

we have office365 tenant with hybrid configuration where exchange is on-premises.
in this scenario is it possible that the userphoto is searched in the on-premises exchenge?
Could this possibly explain the BadGateway error?
Power Apps could reach the userphoto stored in on-premises exchenge?

many thanks for your help!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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