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 / Help on delegation wor...
Power Apps
Answered

Help on delegation work around. enable gallery to show more than 2000 records.

(0) ShareShare
ReportReport
Posted on by 28
Hi,
 
First of, I'm a newbie on this as I'm only a casual user of PowerApps. Please be gentle ;P
 
I have a PowerApps productivity tracker that records the time start and end of the activity. This is recorded in a SP list (Test3) which is utilized by all App users. 
 
My problem is when my SP list reached 2000 records, the gallery will no longer show the latest entries of the user even though it is filtered to only show the "user" entries. 
 
Here's how I formulated the gallery item:
 
//Items//

FirstN(Sort(
   Filter(
      Test3,
      //Check if length of selected is zero, else filter by that selection
      Len(DropdownCanvas1.Selected.Value)=0 || DropdownCanvas1.Selected.Value = NPT.Value,
      Lower('Created By'.Email) = Lower(User().Email)
    ), 
   ID,SortOrder.Descending
   ),
500
)
The requirement is:
1. Filter to show only the users entries
2. Show the latest entry of the user on top
3. Allow population even if records are more than 2000 records
 
Appreciate any advice/help. 
Categories:
I have the same question (0)
  • Ytalo Silva Profile Picture
    185 Moderator on at

    Hello, there are a few ways to retrieve records that exceed 2000. If you're having difficulties with this and want to fetch more than 2000 records, one suggestion is to create a collection in the app's OnStart as follows:

    ClearCollection(
    colMore2000Records,
    Test3,
    Lower('Created By'.Email) = Lower(User().Email)
    ) // Up to 2000 records

    // 4000 records
    Collect(
    colMore2000Records,
    Test3,
    Lower('Created By'.Email) = Lower(User().Email),
    ID >= 2000
    )

    This way, it will fetch more than 2000 records.

    Another suggestion is to create a pagination system that adds more records to the collection as you navigate through the pages.

    If you encounter a delegation warning on the ID field, one solution is to create a mirrored column of the ID in number format. This can help resolve the delegation warning.

    I hope this helps provide some guidance.

  • Verified answer
    WarrenBelz Profile Picture
    154,492 Most Valuable Professional on at
    The issue is around the two non-delegable functions Lower and FirstN. You should not need Lower as 'Created By' will be a case-sensitive exact email address of the user, which will always match User().Email. You can then deal with FirstN as below, which will be applied to a fully Delegable query output.
    With(
       {
          _Data:
          Sort(
             Filter(
                Test3,
                Len(DropdownCanvas1.Selected.Value) = 0 || 
                NPT.Value = DropdownCanvas1.Selected.Value,
                'Created By'.Email = User().Email
             ), 
             ID,
             SortOrder.Descending
          )
       },
       FirstN(
          _Data,
           500
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee
  • ZERAREZ Profile Picture
    28 on at
    Thank you @WarrenBelz, the change you mentioned fixed the gallery view. Thank you again! 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard