cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to only return the most recent records from Sharepoint list? Delegation warning.

I have an app I made over a year ago that is now running into the 2000 record limit. It was supposed to be replaced with something else so I did not troubleshoot it at the time but the replacement was delayed. 

 

My job duties have changed and I no longer have time to trouble shoot this and I am out of practice with the formulas anyway. I would like to adjust it so only the most recent 500 records are pulled into the gallery list in the app.

 

Formula:  

 

SortByColumns(Filter([@'Test Global Micro KPI''s'], StartsWith(Site.Value, TextInput1.Text)), "Title", If(SortAscending1, Ascending, Descending), "Date", If(SortAscending1, Ascending, Descending))

 

kohrt_0-1617213560526.png

 

Can anyone give me some guidance on how to adjust the formula so only the most recent 500 records are displayed?

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Anonymous ,

Try this

SortByColumns(
   Filter(
      Sort(
         [@'Test Global Micro KPI''s'], 
         ID,
         Descending
      ),
      StartsWith(
         Site.Value, 
         TextInput1.Text
      )
   ), 
   "Title", 
   If(
      SortAscending1, 
      Ascending, 
      Descending
   ), 
   "Date", 
   If(
      SortAscending1, 
      Ascending, 
      Descending
   )
)

 

Please click Accept as solution 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 Thumbs Up.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @Anonymous ,

Try this

SortByColumns(
   Filter(
      Sort(
         [@'Test Global Micro KPI''s'], 
         ID,
         Descending
      ),
      StartsWith(
         Site.Value, 
         TextInput1.Text
      )
   ), 
   "Title", 
   If(
      SortAscending1, 
      Ascending, 
      Descending
   ), 
   "Date", 
   If(
      SortAscending1, 
      Ascending, 
      Descending
   )
)

 

Please click Accept as solution 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 Thumbs Up.

Anonymous
Not applicable

That seems to work, thank you! The delegation warning is still present. Will that cause any issues down the road? 

Hi @Anonymous ,

No as you have used the most recent records, however if you do not want to see the warning (the data will still always be the same), do this

With(
   {
      wList:
      Sort(
         [@'Test Global Micro KPI''s'], 
         ID,
         Descending
      )
   },
   SortByColumns(
      Filter(
         wList,
         StartsWith(
            Site.Value, 
            TextInput1.Text
         )
      ), 
      "Title", 
      If(
         SortAscending1, 
         Ascending, 
         Descending
      ), 
      "Date", 
      If(
         SortAscending1, 
         Ascending, 
         Descending
      )
   )
)

 

Please click Accept as solution 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 Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,404)