cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Getting the latest 500 SharePoint List records before using non-delegation functions

I'm working on my first PowerApp, and I'm not 100% on the delegation stuff. 

 

My app will be used to view 80-100 records that are added each week to a SharePoint List. Those records being need to be available in the app for a few weeks, but any longer isn't really necessary as long as they can be accessed via the list itself for special cases.  So limiting the app to 500 records is perfectly fine.

 

However, I have some filters on the Gallery that cannot be delegated. This means that after 5-6 weeks when there are over 500 records, the app will stop showing anything new because it pulls the first 500 records in the list and not the last 500.

 

Is there a way I can reverse which 500 records it pulls, maybe in the List itself? Is it possible to do nested filters so the first filter pulls the latest 500 records, which in turn passes them to the functions that can't be delegated?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Hi @imscavok,

Sort is always delegated and SharePoint adds a sequential ID to every record. If you sort your list with Sort(yourlist,ID,Descending) shouldn’t run into delegation problems and warnings as long as you use Filter() and StartsWith() to search your data. 

 

Tip: all new users should review the Powerapps documents https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview and https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-list#prerequisites

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Hi @imscavok,

Sort is always delegated and SharePoint adds a sequential ID to every record. If you sort your list with Sort(yourlist,ID,Descending) shouldn’t run into delegation problems and warnings as long as you use Filter() and StartsWith() to search your data. 

 

Tip: all new users should review the Powerapps documents https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview and https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-list#prerequisites

View solution in original post

Highlighted

I have non-delegatable functions within my filter function, including a togglable filter to check if if the record is from this calendar week, and a switch to filter based on categories in a drop down box. Putting the delegatable Sort on the outside of this function is still pulling from the beginning of the list rather than the end. Is it possible to get the latest records without delegation of every function?

 

Sort(Filter('Weekly Report',If(Toggle1.Value= true , true ,Created>=DateAdd(Today(),1-Weekday(Today(),StartOfWeek.Sunday))),StartsWith(Title,TextSearchBox1.Text),Switch(Category_DD.Selected.Value,Category_x0020__x0023_1.Value, true ,Category_x0020__x0023_2.Value, true ,Category_x0020__x0023_3.Value, true ,Category_x0020__x0023_4.Value, true ,Category_x0020__x0023_5.Value, true ,"All Categories", true )),ID,Descending)

 edit: Nevermind, I put the sort where the 'Weekly Report' is and that seems to have made it work.

Adding sort(yourlistname,ID,descending) to the filter worked for me!  Quick and easy way to show the most recent items and get around the 500 item limit!  For example:

 

Filter(Sort(YourListName, ID,Descending), StartsWith(Site.Value,sortVar), Month(itemDate) = _Month)

 

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,513)