cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StuCundy
Post Patron
Post Patron

Filter on Gallery delegation issue

Hi there

 

I have the following filter which works but I just get lots of blue lines. 

If(
    StudentTitleDD5.Selected.Result="Select Student",
    Filter(LongTermStudents,ProgramStartDate <= Today () And ProgramEndDate >= Today ()),
    Filter(LongTermStudents, Title = StudentTitleDD5.Selected.Result And ProgramStartDate <= Today () And ProgramEndDate >= Today () And

 StartsWith(Title, TextSearchBox1.Text))
    
    )

delegation issue.png

 

If someone could help be correct these that would be awesome.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Drrickryp
Super User II
Super User II

Hi @StuCundy 

The problem is that >= and <= are not delegatable when applied against date values in SharePoint.  ref. https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/ .  This is not a problem unless the number of dates in the list being filtered exceeds the maximum of 2k. There is a thread here that addresses a work around by @RandyHayes  ref: https://powerusers.microsoft.com/t5/Building-Power-Apps/Problems-with-delegation-when-filtering-by-d... 

View solution in original post

How many live records will you ever have?  Eg:  I have a vehicle booking system that I use dates but thankfully I never any more that 700 live (open) bookings so every day I archive closed ones to a duplicate list.  I merge the two later in excel for reports.

 

I changed the delegation level to 2000  in the advanced setting.  Now I never have an issue.  That has worked for 4 years now

 

Another way to do this if you don't like the above and say the live records are all in the last 2000 entries all teh time is sort descending,  then even though non delegable the records will be in the range

View solution in original post

5 REPLIES 5
Drrickryp
Super User II
Super User II

Hi @StuCundy 

The problem is that >= and <= are not delegatable when applied against date values in SharePoint.  ref. https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/ .  This is not a problem unless the number of dates in the list being filtered exceeds the maximum of 2k. There is a thread here that addresses a work around by @RandyHayes  ref: https://powerusers.microsoft.com/t5/Building-Power-Apps/Problems-with-delegation-when-filtering-by-d... 

View solution in original post

How many live records will you ever have?  Eg:  I have a vehicle booking system that I use dates but thankfully I never any more that 700 live (open) bookings so every day I archive closed ones to a duplicate list.  I merge the two later in excel for reports.

 

I changed the delegation level to 2000  in the advanced setting.  Now I never have an issue.  That has worked for 4 years now

 

Another way to do this if you don't like the above and say the live records are all in the last 2000 entries all teh time is sort descending,  then even though non delegable the records will be in the range

View solution in original post

Hi @leyburn19 

I agree.  Wont be an issue ever.

v-xida-msft
Community Support
Community Support

Hi @StuCundy ,

Could you please share a bit more about your data source? Is it a SP List?

How many records stored in your SP List? More than 2000?

 

Based on the screenshot that you mentioned, I think you have faced Delegation warning issue with your formula. Currently, the Date type column of SP List could not be delegated within Filter function.

Please check the following article for more details:

https://docs.microsoft.com/en-us/connectors/sharepointonline/#power-apps-delegable-functions-and-ope...

 

If the amount of your SP List records is not more than 2000, you could ignore this Delegation warning issue. If the amount of your SP List records is more than 2000, you could only process first 2000 records at most locally within your app.

Note: Please set the “Data row limit for Non-delegable queries” option within Advanced settings of App settings of your app to maximum value -- 2000.

 

If your SP List records is more than 2000, as an alternative solution, you could consider bulk-load your SP List records into a collection in your app, then use the collection as data source in your above Filter function instead of original SP List.

Please check and see if the following threads would help in your scenario:

http://rezadorrani.com/index.php/2019/09/18/powerapps-delegation-with-sharepoint-as-a-data-source-wi...

https://powerusers.microsoft.com/t5/Building-PowerApps-Formerly/Sort-gallery-with-multiple-fields/td...

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Delegation-Formula-Help/m-p/394039#...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I should have mentioned I do the archive process using flow, so it happens automatically.  Users have to do nothing

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (70,893)