Showing results for 
Search instead for 
Did you mean: 
Level 8

How to make User Photos in gallery load faster.

I am building an employee list. The gallery is populated using:


Office365Users.SearchUser({ searchTerm: txt_SearchBox.Text, top:999 })


I'm using the following code for the user photo.


Office365Users.UserPhotoMetadata(ThisItem.Id).HasPhoto = true,


If item has no ID a placeholder image is displayed. If an ID is present and the user has a profile photo the photo is displayed. If no image then the placeholder is displayed.



Screen Shot 2019-11-07 at 07.25.22.png


This works but the photos are slow to load. I was wondering if there's a way to speed this up? 


Another problem is when the user refines using the A-Z buttons then goes back to the All view, all the employees and photos have to load again which is not making for a good user experience.


I was toying with the idea of having two galleries - one with all employees that gets displayed when user clicks All and another gallery for refining employees by first letter. The idea being the gallery with all employees would only need to load once.




Dual Super User
Dual Super User

Re: How to make User Photos in gallery load faster.

Hey @Digital 


Can you try to update the gallery config as:

Items: Filter(AddColumns(Office365Users.SearchUser(),"Image",If(
Office365Users.UserPhotoMetadata(Id).HasPhoto = true,
)),If(SelectedFilter = "All",true, StartsWith(DisplayName,SelectedFilter)))

Image inside Gallery Item

Image -> ThisItem.Image

I have already added the expression for filter based on selection. Now, to set the SelectedFilter variable, you need to add the below expressions to the buttons above.

All Button -> Set(SelectedFilter, "All")
A Button -> Set(SelectedFilter, "A")
b Button -> Set(SelectedFilter, "B") and so on.


Hope this Helps!


If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources


Power Apps Super User Class of 2020

Check it out!


New Badges

Check it out!


Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,901)