How can I display a users name and profile photo in gallery of SharePoint list items?
I have a collumn named "Assessor" and whilst I've got my display name showing, Id also like to display my profile photo.
Solved! Go to Solution.
Hi @sudosaurus ,
Is your column Assessor a Person column?
If yes, I did a test on my side for your reference(My Person column called persondefault1).
Inside the gallery, add a Image control and set its Image property using below formula:
Note: Actually we can directly use Office365Users.UserPhotoV2(ThisItem.XXX.Email) to display user profile photo. But for avoiding "invalid value for the userId parameter" error, we need to add some judge conditions using If function.
If(
!IsBlank(ThisItem.persondefault1.Email),
If(
Office365Users.UserPhotoMetadata(ThisItem.persondefault1.Email).HasPhoto = true,
Office365Users.UserPhotoV2(ThisItem.persondefault1.Email)
))
Then add a Label control inside the gallery and set its Text property to:
ThisItem.persondefault1.DisplayName
Best regards,
Allen
you can use the Office365Users connector and the "UserPhotoV2()" function. It is described well in the following link: https://powerusers.microsoft.com/t5/Building-Power-Apps/How-do-I-use-the-the-Office365Users-quot-Use...
Hi @sudosaurus ,
Is your column Assessor a Person column?
If yes, I did a test on my side for your reference(My Person column called persondefault1).
Inside the gallery, add a Image control and set its Image property using below formula:
Note: Actually we can directly use Office365Users.UserPhotoV2(ThisItem.XXX.Email) to display user profile photo. But for avoiding "invalid value for the userId parameter" error, we need to add some judge conditions using If function.
If(
!IsBlank(ThisItem.persondefault1.Email),
If(
Office365Users.UserPhotoMetadata(ThisItem.persondefault1.Email).HasPhoto = true,
Office365Users.UserPhotoV2(ThisItem.persondefault1.Email)
))
Then add a Label control inside the gallery and set its Text property to:
ThisItem.persondefault1.DisplayName
Best regards,
Allen
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
191 | |
66 | |
45 | |
42 | |
20 |
User | Count |
---|---|
244 | |
120 | |
83 | |
74 | |
69 |