web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power Apps Delegation ...
Power Apps
Suggested Answer

Power Apps Delegation warning

(1) ShareShare
ReportReport
Posted on by 121

In my app i have a gallery with dropdown filters and search box. and I have this function (snip below)

In the gallery list I need to show all the status except for Inactive/Ineligible. but in this function 'PS_Status.Value <>' is giving me a delegation warning. any advice of work around?

I have the same question (0)
  • Suggested answer
    Haque Profile Picture
    190 on at
    Hi @abbyamante,
     
    In my  view, probably, Power Apps does not delegate the "not equal" (<>) operator well on complex fields like choice or lookup columns  - is one of the reasons   you’re seeing delegation warning with PS_Status.Value <> "Inactive/Ineligible".
     
    Approach-1:
     
    To address this let's do a two steps filter: before natural Filter, let's use RemoveIf(non-delegable, I assume works for smaller datasets).
     
    RemoveIf(
        Filter(
            SpecialtyMedsTracker,
            //--Your existing StartsWith and dropdown filter conditions here
            StartsWith(Resident, srchBx.Value) || 
            StartsWith(PatID, srchBx.Value) || 
            // ... other StartsWith conditions ...
            (IsBlank(cb_psStat.Selected.Value) || cb_psStat.Selected.Value = PS_Status.Value) &&
            (IsBlank(cb_ospStat.Selected.Value) || cb_ospStat.Selected.Value = OSPStatus.Value)
        ),
        PS_Status.Value = "Inactive/Ineligible"
    )
    
    This filters first with delegable conditions, then removes the unwanted status locally. This avoids delegable warning but fit for small dataset(2K records).
     
    Approach-2:
     
    What about a calculated column in your database (SP or Dataverse) to flag active records? To do so - we can introduce a Yes/No column that flags whether the status is active (e.g IsActive) and then filter on this column instead of PS_Status.Value <> "Inactive/Ineligible". To be specific, this will avoid delegation issue because filtering on Yes/No or text columns with simple equality is delegable.

    Approach-3:

    Bit tricky way can be using a StartsWith or = in place of <>! Then, instead of excluding "Inactive/Ineligible", include only the statuses you want by explicitly filtering:

    Filter(
        SpecialtyMedsTracker,
        PS_Status.Value = "Active" || PS_Status.Value = "Pending" // list all allowed statuses
        && // other conditions
    )

     

    I assume if the number of allowed statuses is small and known - this is delegable.

    Note: Our main goal will be to avoid <> for complex fields.

     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
     
  • WarrenBelz Profile Picture
    153,773 Most Valuable Professional on at
    Just clarifying a few things. the Not operator (in yours <> or not equals) is not Delegable on any type of field in SharePoint, so is something that needs to be considered and managed. @Haque is correct that the best way of managing it in your case is to list the values you want, rather than the ones you do not want. Also calculated columns do not support Delegation.
     
    My main comments however are around three things
    • You need additional bracketing to separate your And and Or arguments 
    • You have tested the PSStatus.Value field twice - one in the filter in question and the other with a Combo Box - are both necessary ?
    • On a minor note Len() instead of IsBlank is a better option as it also picks up empty strings.
    Sort(
       Filter(
          SpecialtyMedsTracker,
          (
             StartsWith(
                Resident, 
                srchBx.Value
             ) ||
             StartsWith(
                PatID,
                srchBx.Value
             ) ||
             StartsWith(
                Rx,
                srchBx.Value 
             ) ||
             StartsWith(
                'Ro#',
                srchBx.Value 
             ) ||
             StartsWith(
                MOP,
                srchBx.Value 
             ) ||
             StartsWith(
                FacID,
                srchBx.Value 
             ) || 
             StartsWith(
                NDC,
                srchBx.Value 
             ) ||
             5tartsWith(
                Drug,
                srchBx.Value 
             ) ||
             StartsWith(
                Title,
                srchBx.Value
             )
          ),
          Len(cb_psStat.Selected.Value) = 0 || cb_psStat.Selected.Value = PSStatus.Value, 
          Len(cb_ospStat.Selected.Value) = 0 || cb_osp5tat.Selected.Value = OSPStatus.Value, 
          (PSStatus.Value = "Active" || PSStatus.Value = "Eligible" || PSStatus.Value = "Whatever")
       ),
       ReportDate,
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 105 Most Valuable Professional

#2
Haque Profile Picture

Haque 77

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 70

Last 30 days Overall leaderboard