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 / Photo or author's init...
Power Apps
Unanswered

Photo or author's initials in the gallery

(0) ShareShare
ReportReport
Posted on by 45

I have a photo outside the gallery that displays the user's current photo or his initials if he does not have a profile photo (I use an external website UI AVATARS).

Everything works fine and the code looks like this:

If(
 IsBlank(UżytkownicyusługiOffice365.UserPhotoV2(User().Email));
 "https://ui-avatars.com/api/?name=" & Left(User().FullName; 1) & "+" & Mid(User().FullName; Find(" "; User().FullName) + 1; 1) & "&background=0075D4&color=FFFFFF";
 UżytkownicyusługiOffice365.UserPhotoV2(User().Email)
)

 

 

I have a problem with a similar setting but in the gallery. I want to set it to display photos of the author of the entry from the SharePoint list, and if the author does not have a photo, display his initials.
The code looks like this but if someone does not have a profile photo, the initials are only shown for a second after refreshing the gallery and the image disappears.

If(
 !IsBlank(ThisItem.Author.Email);
 UżytkownicyusługiOffice365.UserPhotoV2(ThisItem.Author.Email);
 "https://ui-avatars.com/api/?name=" & Left(ThisItem.Author.DisplayName; 1) & "+" & Mid(ThisItem.Author.DisplayName; Find(" "; ThisItem.Author.DisplayName) + 1; 1) & "&background=FFFFFF&color=0075D4"
)

 

 

I also tried to use an uploaded photo ("TESTIMAGE") to display it if someone does not have a profile photo. But there is the same problem. If someone has a profile photo, it is displayed, but if they don't, a replacement photo appears for a second after refreshing the gallery and disappears.
The code looks like this:

If(
 !IsBlank(ThisItem.Author.Email);
 UżytkownicyusługiOffice365.UserPhotoV2(ThisItem.Author.Email);
 TESTIMAGE
)

 

 

And this code has the same problem:

If(
 !IsBlank(ThisItem.Author.Email);
 If(
 IsBlank(UżytkownicyusługiOffice365.UserPhotoV2(ThisItem.Author.Email));
 TESTIMAGE;
 UżytkownicyusługiOffice365.UserPhotoV2(ThisItem.Author.Email)
 );
 TESTIMAGE
)

 

 

Unfortunately, my knowledge ends here and I don't know how to solve this problem to display it in one photo control.

Categories:
I have the same question (0)
  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at
    1. Use Default Property: Set the default property of the Image control in your gallery to the placeholder image or initials. This ensures that there's always a default image displayed, and it won't flicker when loading the actual image.

    2. Preload Images: You can try preloading the images in advance to reduce flickering. One way to do this is by using a collection to store the images before displaying them in the gallery.

      ClearCollect( ImageCollection, YourImageLogicHere )

      Then, in your gallery, use LookUp to retrieve the image from the collection.

      LookUp(ImageCollection, Author.Email = ThisItem.Author.Email).Image
    3. Set Image Visibility: You can use the Visible property to control the visibility of the image based on whether it's blank or not.

      If( !IsBlank(ThisItem.Author.Email); If( IsBlank(UżytkownicyusługiOffice365.UserPhotoV2(ThisItem.Author.Email)); false; true ); false )

      This way, the image control won't even be visible if there's no photo.

    Try implementing these suggestions and see if they help in resolving the flickering issue. Let me know how it goes!

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