web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display name and profi...
Power Apps
Answered

Display name and profile photo in gallery?

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

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.

sudosaurus_0-1625849455491.png

 

Categories:
I have the same question (0)
  • DylanSimons Profile Picture
    326 on at

    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-UserPhoto-quot-option/m-p/64982/highlight/true#M26722

  • Verified answer
    v-albai-msft Profile Picture
    Microsoft Employee on at

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

    valbaimsft_0-1626058292473.png

    Then add a Label control inside the gallery and set its Text property to:

    ThisItem.persondefault1.DisplayName

    valbaimsft_1-1626058342384.png

    Best regards,

    Allen

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Thank you @v-albai-msft - very useful to know! 🙂

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard