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 / Display people picker ...
Power Apps
Unanswered

Display people picker field image in gallery

(0) ShareShare
ReportReport
Posted on by 294

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

 

 

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    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.

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    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.

  • ck25415 Profile Picture
    294 on at

    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,

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    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

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @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.

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

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

  • ck25415 Profile Picture
    294 on at

    @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,

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    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: "."
    }
  • ck25415 Profile Picture
    294 on at

    @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,

  • Naval_Verma Profile Picture
    30 on at

    Thisitem.picture works faster and is more feasible as compared to "Ofiice365Users" connector as per my experience but "Thisitem.picture" is only working if I am having "admin" access on the SharePoint site.

    Why is it so? Is there any workaround to make it work with lower permission levels?

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard