cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
davidstone
Level 8

Filtering a gallery is painfully slow

In all of the 10 or so PowerApps I've created recently it appears that filtering galleries is slow - often only fractions of a second, but slow enough that it gives an impression to my end users of the technology being 'clunky'.

 

The obvious solution would be to hide the gallery while an update is in progress, but unfortunately there appears to be no way of detecting that.

 

Here's an example. My data is a SharePoint list with 100 rows and 5 categories. On the first page of the app I have a button for each category. Each button applies a filter to the gallery on the next page, and then switches to it. The result is that the same gallery will always show 20 items, filtered according to which category you selected. So far so good.

 

Except that if you go back and select a different category, when the next page shows you can still see the records from the previous filter. Depending on the dataset in question it can be a fairly brief transition, and if I could only hide the gallery and replace it with a 'loading' gif then the delay is perfectly acceptable.

 

I have seen that you can, for example, hide a gallery, show a gif, execute a refresh, and then hide the gif and show the gallery again - that trick works great because there's an actual refresh action happening. The same doesn't work for a filter operation.

 

Other processing can affect the time it takes for the gallery to update too. For example if each row performs a calculation. You can see the standard loading animation with the dots rolling left to right across the top of the screen, so PowerApps itself is obviously aware that it's 'busy', but it would be great if we could also detect and respond to this.

 

Am I missing a solution that's already in place, or do I need to raise this as a suggestion?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filtering a gallery is painfully slow

Hi @davidstone,

 

If the corresponding data is not too large, then you may consider create a local collection and filter the data locally.

Create and update a collection in your app

 

This may reduce the query time to the data source.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Filtering a gallery is painfully slow

Hi @davidstone,

 

If the corresponding data is not too large, then you may consider create a local collection and filter the data locally.

Create and update a collection in your app

 

This may reduce the query time to the data source.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Re: Filtering a gallery is painfully slow

I have noticed this with data being loaded in and there being a delay between the data on screen updating to whatever the new information is. This would happen with View Forms for me and such sometimes too. However, what I did is kind of like what you described.

 

I put a semi transparent black rectangle on the screen with a loading gif in front of it that goes away after the data "loads".

 

For instance:

clip.PNG

 

How this works:

 

I set up a context variable that is set to whatever the data is you are trying to load.

 

For example, UpdateContext({getItem: ((insert gallery filter/data here)) })

 

This goes in the OnVisible property of the screen.

Then, on the rectangle and the gif - Set the Visible property of each to IsBlank(getItem)

The way this works is these items will remain visible until the getItem context variable isn't Blank. This gives enough time for the right data to load without the user going "Why is the old data still showing?"

 

Also, remember to also put UpdateContext({getItem: Blank()}) in the OnHidden property of the screen to reset this variable so that it behaves this way everytime you visit the page.

 

Now you have a custom loading screen!

 

If you wanted to do what you describe I would assume you would set the Visible property of the gallery to !IsBlank(getItem). So it would be visible when the getItem context variable has something in it and set the loading gif to IsBlank(getItem) like described above.

 

Just a suggestion until we have a better solution in place..

davidstone
Level 8

Re: Filtering a gallery is painfully slow

@v-micsh-msft I've been through a couple of apps and added a ClearCollect, pointed the galleries to the local collections instead of the source data, and it's made a huge difference. Sometimes there's still a delay when filtering, but critically it's not showing old data while I'm waiting for the new data to display. Huge improvement - many thanks!

davidstone
Level 8

Re: Filtering a gallery is painfully slow

@Anonymous, your solution is helpful in some circumstances, but there's not always a page change, and the OnVisible sometimes fires before the processing is finished.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 418 members 4,951 guests
Please welcome our newest community members: