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 / Filter Delegation Error
Power Apps
Answered

Filter Delegation Error

(0) ShareShare
ReportReport
Posted on by 2

Hi Guys, 

 

I am fairly new to PowerApps and working on creating an application for one of my Teams, it is a Case Management System and I have created a Search Cases page that lists all Cases in a Gallery with a set of Filters to filter down the list so that users can find a specific case. 

 

The gallery is working as intended but I am receiving a delegation warning with the StartsWith functions. Now I am not expecting for there to be anywhere close to 500 cases but I would like to get around the delegation warning but cannot work it out. My Filter function is as follows; 

 

SortByColumns(
Filter(
Cases,
IsBlank(radFiltersStatus.Selected.Value) || IsEmpty(radFiltersStatus.Selected.Value) || CaseStatus = Text(radFiltersStatus.Selected.Value),
IsBlank(txtFiltersReference) || StartsWith(Reference, "CSE-" & txtFiltersReference.Text),
IsBlank(ddFiltersCaseType) || CaseType = ddFiltersCaseType.Selected.Title,
If(radFiltersUserType.Selected.Value = "Employee", StartsWith(EmployeeName, txtFiltersUserType.Text),
radFiltersUserType.Selected.Value = "HR Advisor", StartsWith(HRAdvisor, txtFiltersUserType.Text),
radFiltersUserType.Selected.Value = "Created By", StartsWith(CreatedBy, txtFiltersUserType.Text)) || IsBlank(txtFiltersUserType)), locSortBy, If(locSortBy = "StartDate", Descending, Ascending))

 

I put this formula together using a series of YouTube guides/videos as reference so it may not be the best written formula, 

 

Is there anyway that I can rewrite this formula to avoid the delegation warning? I have looked a lot online and cannot work it out and this would be extremely useful for best practice going forward, 

 

Thank you in advance

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,312 Most Valuable Professional on at

    Hi @JackTann ,

    Firstly set the Default of txtFiltersUserType to "" (empty string) and then try this - NOTE free-typed, so watch commas/brackets etc.

    With(
     {
     wRef: "CSE-" & txtFiltersReference.Text,
     wEmp: radFiltersUserType.Selected.Value = "Employee",
     wHR: radFiltersUserType.Selected.Value = "HR Advisor",
     wCB: radFiltersUserType.Selected.Value = "Created By",
     wSortD: locSortBy = "StartDate"
     },
     SortByColumns(
     Filter(
     Cases,
     (
     Len(radFiltersStatus.Selected.Value) = 0 || 
     CaseStatus = Text(radFiltersStatus.Selected.Value)
     ) && 
     StartsWith(
     Reference, 
     wRef
     ) &&
     (
     Len(ddFiltersCaseType.Selected.Title) = 0 || 
     CaseType = ddFiltersCaseType.Selected.Title
     ) &&
     (
     IsBlank(txtFiltersUserType.Text) ||
     (
     !wRad || 
     StartsWith(
     EmployeeName, 
     txtFiltersUserType.Text
     )
     ) &&
     (
     !wHR ||
     StartsWith(
     HRAdvisor, 
     txtFiltersUserType.Text
     )
     ) &&
     (
     !wCB ||
     StartsWith(
     CreatedBy, 
     txtFiltersUserType.Text
     )
     )
     )
     ), 
     locSortBy, 
     If(
     wSortD, 
     Descending, 
     Ascending
     )
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#2
11manish Profile Picture

11manish 165 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 110 Super User 2026 Season 2

Last 30 days Overall leaderboard