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 / How can I Rewrite this...
Power Apps
Answered

How can I Rewrite this gallery filter code without delegation?

(0) ShareShare
ReportReport
Posted on by 520

Hi, could anyone help me please, rewrite this gallery code in order to not have the delegation warning appear.

Sort(
 Filter(
 S2DM_GeneralInfo As galtable,
 (
 (drpPhases.Selected.Value = "All Phases") Or galtable.RequestPhase.Value = drpPhases.Selected.Value) 
 And (!togCreatedBy.Value Or galtable.'Created By'.Email=_user.mail) 
 , If ("NTA" in drpRequiredTabs.SelectedItems.Value, galtable.NTARequired=true, !IsBlank(galtable.NTARequired=true))
 , If ("Data Protection" in drpRequiredTabs.SelectedItems.Value, galtable.isDPrequired=true,!IsBlank(galtable.isDPrequired=true))
 , If ("Computerized System Validation" in drpRequiredTabs.SelectedItems.Value, galtable.isCSVrequired=true,!IsBlank(galtable.isCSVrequired=true))
 ,
 SearchBox.Text in
 Switch(drpFilters.Selected.Value,
 "Project Name", galtable.Title,
 "Request ID", galtable.DemandID,
 "NTA Number", galtable.SolutionID
 )

 ),
 Created,
 If(SortDescending1, Descending, Ascending)
)

 

Robert94_0-1653554591782.png

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @Robert94 ,

    Firstly, the below is free-typed and is structure guidance, so watch commas/brackets etc. I also have some notes as I do not understand the logic of a few of the filters. You need to keep all Delegable filters "up the top" BUT note the the top filter can only return (it can filter any number) item numbers up to your Delegation limit

    With(
     {
     wList:
     With(
     {
     wNTA:"NTA" in drpRequiredTabs.SelectedItems.Value, 
    	 wData: "Data Protection" in drpRequiredTabs.SelectedItems.Value, 
    	 wValid: "Computerized System Validation" in drpRequiredTabs.SelectedItems.Value
     },
     Sort(
     Filter(
     S2DM_GeneralInfo,
     (
     drpPhases.Selected.Value = "All Phases" Or 
     RequestPhase.Value = drpPhases.Selected.Value
     ) And 
     If(
     wNTA, 
     NTARequired,
     !IsBlank(NTARequired=true) //What is this ??
     ) And
     If(
     wData, 
     isDPrequired,
     !IsBlank(isDPrequired=true) //What is this ??
     ) And
     If(
     wValid,
     isCSVrequired,
     !IsBlank(isCSVrequired=true) //What is this ??
     )
     ),
     Created, 
     If(
     SortDescending1, 
     Descending, 
     Ascending
     )
     )
     )
     },
     Filter(
     wList,
    	 (
     !togCreatedBy.Value Or 
     'Created By'.Email=_user.mail
     ) And
     SearchBox.Text in
     Switch(
     drpFilters.Selected.Value,
     "Project Name", 
     galtable.Title,
     "Request ID", 
     galtable.DemandID,
     "NTA Number", 
     galtable.SolutionID
     )
     )
    )

     

    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.

    Visit my blog Practical Power Apps

  • Robert94 Profile Picture
    520 on at

    Hi @WarrenBelz thank you very much for taking the time to write this, helped me a lot as always, much appreciated,

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

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard