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 / Getting the initials f...
Power Apps
Unanswered

Getting the initials from a people's columns

(0) ShareShare
ReportReport
Posted on by 3,271

Hi there.

I hope someone could point me in the right direction here:

I have a people column in my sharepoint list. and I am displaying in my gallery the person picture. with an image like this:

ThisItem.Project_Manager.Picture.

 

But Some of my users doesn't have a picture. I juts see something like this:

sajarac_0-1713540366073.png

 

I want to show a label only if the Project MAnager has been selected and if the Project Manager Doesn't have a picture.

 

Thanks in advanc for any response.

 

BTW the label that I want to show is the Project Manager initials but that part I've got it working. Thx

 

 

Categories:
I have the same question (0)
  • SebS Profile Picture
    4,582 Moderator on at

    @sajarac 

     

    You can try like this :

     

    Label visible:

     

    If(
     Not(IsBlank(ThisItem.Project_Manager)) && IsBlank(ThisItem.Project_Manager.Picture),
     true,
     false
    )

     

    Now label :

     

    Left(ThisItem.Project_Manager.DisplayName, 1) & Mid(ThisItem.Project_Manager.DisplayName, Find(" ", ThisItem.Project_Manager.DisplayName) + 1, 1)

     

    There is also another option to use Split and First if you have First Name and Surname field in User Profile

     

  • Sajarac Profile Picture
    3,271 on at

    Hey @SebS , thank you very much for your prompt response. I have applied your formula. But I can not see the label after implemented.

     

    sajarac_0-1713550750917.png

     

  • SebS Profile Picture
    4,582 Moderator on at

    @sajarac 

     

    The formula checks if the Project manager is not blank and the Picture is blank.

     

    You can, for now, place true to see the label. I'm unsure if no image is shown as default, which will mess with that formula.

     

    I will need to check in test App I do not remember from top of my head 🙂

     

  • Sajarac Profile Picture
    3,271 on at

    No worries. Take your time. I guess the blank picture is taking as a result that in fact the user has a Photo.

    I will wait for your test.

    Thanks in advance

  • SebS Profile Picture
    4,582 Moderator on at

    @sajarac 

     

    Yes, DefaultImage is used, so it's tricky to do the verification. You can try the below code in the Visible property:

     

    !IsBlank(ThisItem.Project_Manager.Email)
     && Office365Users.UserPhotoMetadata(ThisItem.Project_Manager.Email).HasPhoto

     

    The code for initials is working ok

     

    now there is a blog about how to achieve this as well so have a look into this :

     

    https://www.matthewdevaney.com/power-apps-display-a-user-photo-or-initials/

  • Sajarac Profile Picture
    3,271 on at

    This is the result fotr the latest formula:

    sajarac_0-1713553382468.png

     

    As you can see the user with photo is showing also the label with the initials.

  • Verified answer
    SebS Profile Picture
    4,582 Moderator on at

    @sajarac 

     

    Try only use :

     

    !(Office365Users.UserPhotoMetadata(ThisItem.Project_Manager.Email).HasPhoto)

     

    This shows a boolean when a photo is there so use ! to say if the Picture is Not there, show true

     

  • Sajarac Profile Picture
    3,271 on at

    Awesome! 😀

    That one works !

    Thank you very much for your help! 👍👍👍👍👍

  • SebS Profile Picture
    4,582 Moderator on at

    @sajarac 

     

    No Problem 🙂

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard