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 / Sort and Filter Multip...
Power Apps
Answered

Sort and Filter Multiple options Delegation Warning

(0) ShareShare
ReportReport
Posted on by 65

I have a gallery that I am wanting to filter based on information selected from 2 date pickers and a text box.  I am receiving a delegation warning and I am close to the 2000 limit.  Below is my formula.

 

Sort(Filter(KPUnblocks, ('Created On'-1 >= StartDate.SelectedDate) && ('Created On'-1 <= EndDate.SelectedDate) && (ItemFilter.Text in ItemNumber)),'Created On',Descending)

 

Does anyone have any suggestions on how I can get around the delegation?  It is complaining about the Ands and 'Created On' sections.

 

ptempleton_0-1602524936724.png

 

 

Categories:
  • Verified answer
    DylanSimons Profile Picture
    326 on at

    subtracting 1 from the 'Created on' field is not delegable. You should do the manipulation to the variable in Power Apps rather than the field in your source.

     

    Also, I assume you are subtracting 1 day? you can change it to this:

     

    Sort(Filter(KPUnblocks, ('Created On' >= DateAdd(StartDate.SelectedDate), 1, Days) && ('Created On' <= DateAdd(EndDate.SelectedDate, 1, Days)) && (ItemFilter.Text in ItemNumber)),'Created On',Descending)

     

    You also have the "In" operator, which is unfortunately non-delegable with Sharepoint(I assume that is what you are using).

     

    The only way I see this being resolved is using a collection, so in App OnStart you can do

     

    ClearCollect(MyCollection, KPUnblocks)

     

    and then use MyCollection for all your needs in the Power App.

  • ptempleton Profile Picture
    65 on at

    Thank you!  I am using CDS as the source and this fixed my delegation warning.

     

    Sort(Filter(KPUnblocks, ('Created On' >= DateAdd(StartDate.SelectedDate, 1, Days)) && ('Created On' <= DateAdd(EndDate.SelectedDate, 1, Days)) && (ItemFilter.Text in ItemNumber)),'Created On',Descending)

     

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 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard