cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cmanning
Super User
Super User

Using a Loading Spinner While a Gallery is Loading?

I have yet to find a solution for using a loading spinner while a gallery loads.  You can't use If( IsEmpty(galleryName.AllItems)) and using CountRows is not a great idea for performance issues. This seems like a simple ask, but I can't find a solution.  Any recommendations? 

5 REPLIES 5
RandyHayes
Super User
Super User

@cmanning 

CountRows is not a problem on a gallery.  You can set the Visible property of your icon to: CountRows(yourGallery.AllItems)=0

 

Keep in mind though that if the final result of your gallery happens to be no rows of data, then your icon will continue to show.  

 

You can also use the LoadingSpinner property of the gallery.  But this will only appear in the gallery itself. 

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes - I really appreciate your quick response.  I am using a custom loader and based on your response, it doesn't appear to be the solution since I can't determine when the gallery has loaded using CountRows.  Also I'd like to use this across several screens and one has up to 2k records so I don't want to rely on CountRows because it will impact performance.  Any additional feedback is appreciated.

cmanning
Super User
Super User

Anyone have any other suggestions?

@cmanning 

Can you expand on what you mean by "a custom loader"?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes - Thanks for following up. 
Here is a screenshot of my custom loader (which includes a dark modal background) on a form page where when the user clicks Save the loader will be visible/true and in the form's OnSuccess I set the loader visibility to false.  This allows me to include a modal window to prevent certain user actions and I'd like to use this custom loader on several galleries to indicate the gallery is still loading all items.   
DI App Custom Loader.png
I have yet to find a solution that would allow me to use my custom loader on a gallery.  Sure, I can set the LoadingSpinner property to LoadingSpinner.Data but that doesn't allow me to include a modal window and the default loading spinner does not seem to be visible very long regardless if the gallery has finished loading. 

Can you think of a method to achieve what I'm trying to do with the galleries? Any info is appreciated. 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,439)