cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ck25415
Level 8

Display people picker field image in gallery

Hi,

 

I have a people picker field in sharepoint called people. If i assign Thisitem.people.picture to an image in gallery does it show the image of the person in the poeple field. If not how can I show it ?

 

Thanks

 

 

 

 

9 REPLIES 9
Super User
Super User

Re: Display people picker field image in gallery

This works fine for me.

 

As a sample (to make sure I wasn't imagining it)

I have a Gallery (Gallery1) with the items coming from a SharePoint list that has a People column in it.

I have an image with the Image property set to Gallery1.Selected.PeopleColumn.Picture

 

All is well...EXCEPT, and this is what I recalled from before. 

SharePoint has its own profile pictures stored in the user profile.  It seems that the user has to actually access SharePoint at some time and then it kicks of something that, behind the scenes, will move the user profile photo from Office 365 over into SharePoint.  This sync takes some time.

Once it is there, the above works fine.  Until then, the picture returned is a placeholder photo.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Super User
Super User

Re: Display people picker field image in gallery

Oh, any by the way, your example of having the images in the Gallery (ThisItem.People.Picture) works fine too.  With the previous points noted.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
ck25415
Level 8

Re: Display people picker field image in gallery

Hello @RandyHayes

 

Thanks for the quick reply. I have tried Thisitem.People.Picture for an image in the gallery and also set an Image outside the gallery to Gallery.Selected.People.Picture In both cases i dont see any image not even a placeholder image. I have posted similar question couple of weeks ago (no one replied) when I started to see this issue. I did try a different datsource and a different people picker field and also check with different user.

 

Also I have tried below expression set to an image( I have added Office365Users datasource)

 

If(Office365Users.UserPhotoMetadata(ThisItem.People.Picture).HasPhoto=false,SampleImage,Office365Users.UserPhoto(ThisItem.People.Picture))

 

Thanks,

Super User
Super User

Re: Display people picker field image in gallery

Hmmm, All working here. 

Here is a snip of a Gallery with a sample list of items and a People Column.

The properties are listed at the top row.

 

snipPeople.png

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Super User
Super User

Re: Display people picker field image in gallery

@ck25415By the way, your Office365Users.UserPhoto syntax/parameter was wrong.  You need to pass the ID (email) of the user to it.  You were passing the Picture.  This would definitely not yield any results.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Super User
Super User

Re: Display people picker field image in gallery

@ck25415one more thing.  I should have asked this before.  Are you allowing multiple selections of people in your SharePoint column, or no?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
ck25415
Level 8

Re: Display people picker field image in gallery

@RandyHayes

 

Thanks for the correction, now this expression shows the image of the users but I also see a bad request error message next to the expression.

 

code: BadRequest

message: Unsupported segment type

 

No I am not using multiple selections of people. 

 

Also, one more issue started at the same time, when i set the default property of people picker field in a new form to 

 

{DisplayName:User().FullName,
Claims:"i:0#.f|membership|" & Lower(User().Email),
}

 or 

{DisplayName:User().FullName,
Claims:"i:0#.f|membership|" & Lower(User().Email),
Department:"",
Email:User().Email,
JobTitle:"",
Picture:""}

it does not populate, sharing if this helps in connecting any dots.

 

Thanks,

Super User
Super User

Re: Display people picker field image in gallery

I see HasPhoto return those errors all the time.  I honestly don't know what that issue is all about.  It seems more of an annoyance than a functional problem in most cases.  But to my users, they don't like seeing an error.  I am hoping one day they will recognize and fix that issue, or...still waiting for better error trapping and handling in PowerApps.

 

On to the other.  Here is the syntax you need to use in a Patch or Update function to update that field properly:

 

YourPeopleColumn:  
{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(User().Email),
Department: "",
DisplayName: User().DisplayName,
Email: User().Email,
JobTitle: ".",
Picture: "."
}
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
ck25415
Level 8

Re: Display people picker field image in gallery

@RandyHayes

 

Thanks for the expression to patch/update the person field but I would like to see the person field populate and also allow the user to change it if required so I would like to set the default property instead of using patch/update.

 

I did open a microsoft case on the image issue, I will post here if I get any update on it.

 

Thanks,

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 56 members 3,558 guests
Please welcome our newest community members: