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 Office 365 Use...
Power Apps
Unanswered

Display Office 365 User Profile Picture

(0) ShareShare
ReportReport
Posted on by 67

Hi Members,

 

I had a requirement in Power Apps to display Office 365 User Profile Picture.

 

I have a SharePoint list that has various columns like:

  1. Employee ID = Title
  2. Employee Name = Person or group
  3. Employee Department = Choice

error10.jpg

 

 

 

 

 

 

 

 

 

 

On my Power Apps screen, I need to display the employee details in a gallery control.

 

There, I need to display their profile picture, but some of the Office365 users don't have their profile picture; in that situation, I need to display their initials. How can I achieve this?

 

I tried with the code below, but it's not working. It's not even showing the other pictures.

 

If(
 IsBlank(Office365Users.UserPhotoV2(ThisItem.'Employee Name'.Email)),
 Concatenate(
 Left(ThisItem.'Employee Name'.DisplayName, 1),
 If(
 Len(ThisItem.'Employee Name'.DisplayName) > Find(" ", ThisItem.'Employee Name'.DisplayName),
 Left(Mid(ThisItem.'Employee Name'.DisplayName, Find(" ", ThisItem.'Employee Name'.DisplayName) + 1), 1)
 )
 ),
 Office365Users.UserPhotoV2(ThisItem.'Employee Name'.Email)
)

 

 

errrorr.jpg

 

Can anyone please suggest how I can achieve this? Thanks in advance!

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Hemashree ,

     

    Please try:

    IfError(
     Office365Users.UserPhotoV2(ThisItem.'Employee Name'.Email),
    	"data:image/svg+xml;utf8, "&EncodeUrl("
    <svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'>
     <text x='10' y='50' font-family='Arial' font-size='24' fill='black'>"&Concat(Split(ThisItem.'Employee Name'.DisplayName," ").Value,Left(Value,1)) &"</text></svg>
    "),
     Office365Users.UserPhotoV2(ThisItem.'Employee Name'.Email)
    )

     

    Best Regards,

    Bof

  • HM-22080408-0 Profile Picture
    67 on at

    Hi @v-bofeng-msft ,

    I am still facing the same issue. The user Serena doesn't have a profile picture; it is not displaying her initials.

     

    error101.jpg

     

     

     

    Please help me out! Thank you in advance.

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Hemashree ,

     

    Maybe you could try:

    If(
     IsBlank(Office365Users.UserPhotoV2(ThisItem.'Employee Name'.Email)),
     "data&colon;image/svg+xml;utf8, "&EncodeUrl("
    <svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'>
     <text x='10' y='50' font-family='Arial' font-size='24' fill='black'>"&Concat(Split(ThisItem.'Employee Name'.DisplayName," ").Value,Left(Value,1)) &"</text></svg>
    ")),
     Office365Users.UserPhotoV2(ThisItem.'Employee Name'.Email)
    )

    This formula worked well on my side

    vbofengmsft_0-1711609601675.png

     

    Best Regards,

    Bof

     

  • HM-22080408-0 Profile Picture
    67 on at

    Hi @v-bofeng-msft 

    It is not working for me?

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Hemashree ,

     

    Please try this formula instead:

    If(
     !Office365Users.UserPhotoMetadata(ThisItem.'Employee Name'.Email).HasPhoto,
     "data&colon;image/svg+xml;utf8, "&EncodeUrl("
    <svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='0 0 50 50'>
     <text y='50%' X='50%'>"&Concat(Split(ThisItem.'Employee Name'.DisplayName," ").Value,Left(Value,1)) &"</text>
    </svg>
    "),
     Office365Users.UserPhotoV2(ThisItem.'Employee Name'.Email)
    )

     

    Best Regards,

    Bof

  • HM-22080408-0 Profile Picture
    67 on at

    Hi @v-bofeng-msft 

     

    I don't know why, its not working for me.

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard