Show Loading spinner when a Gallery is loading in Power apps canvas apps

Hello everyone and welcome to my blog. In today’s blog I will discuss about a very interesting topic and something which is required for almost all Power Apps projects.

Suppose you have a Gallery which display a list of records. And it may take a while while the data is fetched and loaded in the Gallery.

By default there is no visual indicator to indicate that the data load process is ongoing. You will see few dots floating across the top of the screen but they are easy to miss. Today I will show you on how to configure a loading spinner when the Gallery is loading the data.

In-fact unknown to many, some controls including the Gallery control in Power Apps has a property called LoadingSpinner. Let’s see how we can use this for our requirement.

Select your Gallery and look for the property ‘LoadingSpinner‘.

By default, the value of this property is set to None. There are in-fact three possible values of this property as you can see the screenshot below.

  • None – This value signifies that the spinner won’t be visible
  • Controls – Setting this value shall show the spinner until all the controls are loaded. You can utilize this to show loading spinner for screen.
  • Data – Setting this value shall show the spinner until data is loaded in the control. This is what we will use for the Gallery control

As explained earlier, I will set the value to LoadingSpinner.Data.

The next is to set the loading spinner color. For that you need to set the property LoadingSpinnerColor.

Most of the times we make the mistake of setting these two properties and when we test it out, we find that the Spinner is not showing up. For the spinner to show up when the Gallery data is loading, you need to set the DelayItemLoading property of the Gallery to true.

So we are all set. And below is how the spinner control looks when the Gallery data is loading.

If you ask me it’s not the perfect solution as there is gap to show up the data finally after the spinner disappears. But this is better than no indicator and considering it’s out of the box, no separate development is required.

In another blog, I will demonstrate on how to show loading spinners on button click and database operations.

Hope you like this post. If this post has helped you, you can buy me a coffee. Links on the right side panel.

You will also like the below posts.

Debajit Dutta
Business Solutions MVP