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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery limitations
Power Apps
Unanswered

Gallery limitations

(1) ShareShare
ReportReport
Posted on by 228

Is there a limitation on how many records can be displayed by a gallery? My datasource is a document library and I am expecting thousands of documents to be stored there. Is there any alternatives or solution to display such amount of data on gallery?

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    There isn't really a limit imposed by the gallery, but there is a limit on how many items you can retrieve at a time.  The default is 500 and the maximum is 2,000.  Normally you will need to filter the data source in some way to keep the items displayed in the gallery below those limits.

  • karl_oliverio Profile Picture
    228 on at

    Hi @Pstork1 ~ thank you for your response. But for example I have a 50,000 items from my data source that needs to be displayed on that gallery, how do i handle such amount of items? Also, I am thinking, will pagination be a solution to this? If so, do you have any useful article there that I can check?

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Pagination is one solution to the problem, but that essentially does what I mentioned in my previous response.  If you filter the list on an ID column soemthing like this Filter(datasource id >= minID && ID <= MaxID) where MinID and MaxID are variables that contain a sliding set of values per page 0,500 - first page; 501,1000 second page, etc. But there is no support in PowerApps for automatic pagination. So you need to design and build it yourself.  Again, you can't retrieve more than 500 to 2,000 records at any one time. You can get the first 500 and then the next 500 etc.

     

    Another common response is to copy the list in batches to a local collection since collections aren't limited in the same way. But there are limits on how much data can be stored locally so I suspect you will still run out of room before you can cache everything you want to display.

     

    The bottom line is that a gallery just isn't designed to display a list of 50,000 items.  But honestly, what user would actually scroll through a list that big anyway.

  • karl_oliverio Profile Picture
    228 on at

    Actually we are trying to create a Document Library UI made out of PowerApps and we are using the Sharepoint Doc Library as its backend. Our company has a roughly 50k released documents and we need to have it all available when we create it on PowerApps.

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    SharePoint Views also can't show 50,000 items at a time in the regular document library.  The solution for both SharePoint and PowerApps is to provide filtered views that limit the number of items displayed to less than the number of items allowed. You will need to find some way to provide user selectable filters that limit the display of your 50,000 files to a more reasonable number.  There is no other real option.

  • karl_oliverio Profile Picture
    228 on at

    If I add a filter fields for the gallery, will it return items from the data source entirely? or will it return only items from the first 500?

  • Verified answer
    Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Take a look at this article on Delegation in SharePoint.

    https://powerapps.microsoft.com/en-us/blog/powerapps-update-large-sharepoint-lists-startswith-delegation-flexible-height-gallery-validation-ismatch-regular-expressions/

    As long as the selection criteria for your gallery use delegable functions to get the number of items returned below the maximum then it will run against the entire list.  The key is that delegable functions do the selection of records on the server not the client.

  • karl_oliverio Profile Picture
    228 on at

    Hi @Pstork1 ~ thank you for your confirmation. I will take it from here then. 

  • RezaDorrani Profile Picture
    12,143 on at

    Hi @karl_oliverio 

     

    The delegation limits specified by @Pstork1  will holds true for PowerApps

     

    However, since you are using SharePoint

    SharePoint queries fail to retrieve items beyond 5k items if the columns being queried are not indexed

    Hence you would have to make sure that you create column indexes in SharePoint if you know your documents will exceed 5k

     

    Also , note that once your library or list exceeds 20k items, you will not be able to add/delete indexes

    Hence plan before hand if you are sure you will exceed the different limits

     

    500 - PowerApps delegation limit (can be increased to max 2k)

    5000 - SharePoint query limit

    20000 - limit after which indexes cannot be created/deleted

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Office365Master Profile Picture
    338 on at

    @Pstork1 wrote:

    Pagination is one solution to the problem, but that essentially does what I mentioned in my previous response.  If you filter the list on an ID column soemthing like this Filter(datasource id >= minID && ID <= MaxID) where MinID and MaxID are variables that contain a sliding set of values per page 0,500 - first page; 501,1000 second page, etc. But there is no support in PowerApps for automatic pagination. So you need to design and build it yourself.  Again, you can't retrieve more than 500 to 2,000 records at any one time. You can get the first 500 and then the next 500 etc.

     

    Another common response is to copy the list in batches to a local collection since collections aren't limited in the same way. But there are limits on how much data can be stored locally so I suspect you will still run out of room before you can cache everything you want to display.

     

    The bottom line is that a gallery just isn't designed to display a list of 50,000 items.  But honestly, what user would actually scroll through a list that big anyway.


    Interestingly enough there are actually ways of retrieving up to 5000 records in a single batch using Flow and v2 of the Graph APIs where automated pagination is possible to leverage to return batch. To put it further perspective, I've created a demo app upon which I will be posting hopefully within the next week.

     

    I posted a video on YouTube today that showcases numurus functionalty that not only address a significant number of features users have been asking for as far back as 2+ years, but furthermore demonstrate features and functionality that very few people would have believed would not even have been possible to incorporate in their own apps a year if not longer from now.

     

    Seeing what is in fact possible now will no doubt have many App Makers super excited, in my opinion at least. Even with the remarkable demo app I've created, it only scratches the surface of what else you could potentially do so check it out, or don't Smiley Tongue:

    https://youtu.be/SYqscqPo9wM

     

    Sample screenshot attached of a screen in PowerApps with a Gallery control populated with almost 5000 photos stored a Site Assets library returned by a single call to a Flow.

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard