web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Very slow gallery sort...
Power Apps
Answered

Very slow gallery sort when displaying SQL records

(0) ShareShare
ReportReport
Posted on by 510

I have a very simple test app which has a camera control, takes a photo and uploads it as base64 to a varchar field in SQL. The table also has a Date, Name and File Name column which are patched with the image data. The app works as expected until I try and view the gallery or sort it by Date, Name or File Name. The gallery template displays the Image, Date, Name and File Name. The gallery takes about 20 seconds to load the data and when I click the sort button, it takes about 15 seconds each time to do the sort. I only have 4 records in my table!
My gallery items property is

 

Sort(ImageList,Date,If(SortAscending,Ascending,Descending))

 

and my sort button OnSelect property is

 

UpdateContext({SortAscending: !SortAscending})

 

I have had a look at this article but don't see anything that might help me:
Considerations for optimized performance in Power Apps
Should I be saving my loaded gallery items to a collection?
When using Excel or SharePoint as a data source, with a lot more records, a sort takes less than a second.

UPDATE: I did find this article which seems a bit more relevant. I will try this method and report the results:

Performance considerations with PowerApps 

Categories:
  • Verified answer
    rwittels Profile Picture
    510 on at

    The second article I linked to is probably the best performance advice you will get with regard to loading SQL data into your Power App.

    I added this at the App OnStart property:

    ClearCollect(imageData, ImageList)

    I changed my gallery Items property to this:

    Sort(imageData, Date, If(SortAscending,Ascending,Descending))

    On app start the data takes about 15 to 20 seconds to load into the collection, which I can indicate to the user with a loading animation, but subsequent gallery interactions, such as sorting, are instant.

     

  • rwittels Profile Picture
    510 on at

    As I add records it takes a little longer to load into the collection. This is an obvious observation however, it takes 22 seconds to load 8 records. How long will it take to load 100 records or 500? Surely there is something I am missing here or is SQL performance in Power Apps just this bad?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard