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 / Alternatives to in ope...
Power Apps
Answered

Alternatives to in operator to avoid delegation?

(0) ShareShare
ReportReport
Posted on by 148

Filter('Survey Responses',StartsWith(Surname,txtnamefilter.Text) && (Status.Value =cbstatusfilter.Selected.Value || cbstatusfilter.Selected.Value = Blank()) && (Dropdown3.Selected.Value = Blank()||Dropdown3.Selected.Value in Responsibility.Value))

 

Above is an example of a filter on a gallery using sharepoint list (over 2000 records) but the 'in' operator is non delegable. 

Are there alternatives for filters looking at multi value fields that are delegable? The Responsibility field above can have multiple options selected

 

thanks

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,413 Most Valuable Professional on at

    Hi @cheezy ,

    The in operator is not delegable in SharePoint - you can do this

    With(
     {
     wList:
     Filter(
     'Survey Responses',
     StartsWith(
     Surname,
     txtnamefilter.Text
     ) && 
     (
     cbstatusfilter.Selected.Value = Blank() ||
     Status.Value =cbstatusfilter.Selected.Value
     ) 
     )
     },
     Filter(
     wList, 
     Dropdown3.Selected.Value = Blank() || 
     Dropdown3.Selected.Value in Responsibility.Value
     )
    )

    and providing the result of the (Delegable) top filter is under your Delegation limit, the in statement at the bottomn will work on those records.

     

    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

  • cheezy Profile Picture
    148 on at

    thanks Warren that works and no delegation warning.

    If a SortbyColumns is to be added, where would you place?

     

    See my attempted formula with SortByColumns below. This errors out.

     

     

    With(
    {
    wList:
    Filter(
    'Survey Responses',
    StartsWith(
    Surname,
    txtnamefilter.Text
    ) &&
    (
    Status.Value = Radio1.Selected.Value || Radio1.Selected.Value = Blank()
    )
    )
    },

    SortbyColumns(
    Filter(
    wList,
    Dropdown3.Selected.Value = Blank() ||
    Dropdown3.Selected.Value in Responsibility.Value
    )
    "create_x0020_date",
    If(SortDescending1,Descending,Ascending)
    )
    )

  • Verified answer
    WarrenBelz Profile Picture
    154,413 Most Valuable Professional on at

    Hi @cheezy ,

    Basic structure correct, but you had an extra bracket at the top and a missing comma at the bottom

    With(
     {
     wList:
     Filter(
     'Survey Responses',
     StartsWith(
     Surname,
     txtnamefilter.Text
     ) &&
     (
     Radio1.Selected.Value = Blank() ||
     Status.Value = Radio1.Selected.Value
     )
     )
     },
     SortByColumns(
     Filter(
     wList,
     Dropdown3.Selected.Value = Blank() ||
     Dropdown3.Selected.Value in Responsibility.Value
     ),
     "create_x0020_date",
     If(
     SortDescending1,
     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.

    Visit my blog Practical Power Apps

  • WarrenBelz Profile Picture
    154,413 Most Valuable Professional on at

    Hi @cheezy ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    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

  • cheezy Profile Picture
    148 on at

    Hi Warren

    Doesnt like the Sortbycolumns additional code - get  the following error

    "The function SortByColumns has some invalid arguments.Invalid argument type ("Text"). Expecting a table value ahead.

     

    Interestingly your initial formula returns 2000 rows as with my initial formula using the non delegable in operator.  So must be related to "providing the result of the (Delegable) top filter is under your Delegation limit" ?

  • WarrenBelz Profile Picture
    154,413 Most Valuable Professional on at

    Hi @cheezy ,

    Two things - you are correct in that the top statement is a "pre-filter" and will only return a result up to your Delegation limit. The bottom filter is then acting on what is essentially a temporary table stored in the app and therefore is not subject to Delegation (it is not going back to the data source) - I have a blog on this that may interest you. Secondly, there is nothing wrong with this code as far as structure is concerned unless you do not have a field called 'create date' and a Variable called SortDescending1. If this is a date field, try the below

    Sort(
     Filter(
     wList,
     Dropdown3.Selected.Value = Blank() ||
     Dropdown3.Selected.Value in Responsibility.Value
     ),
     'create date',
     If(
     SortDescending1,
     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.

    Visit my blog Practical Power Apps

  • cheezy Profile Picture
    148 on at

    great got it to work with this:

     

    With(
    {
    wList:
    Filter(
    'Survey Responses',
    StartsWith(
    Surname,
    txtnamefilter.Text
    ) &&
    (
    Status.Value = Radio1.Selected.Value || Radio1.Selected.Value = Blank()
    )
    )
    },
    Sort( Filter(
    wList,
    Dropdown3.Selected.Value = Blank() ||
    Dropdown3.Selected.Value in Responsibility.Value
    ),

    create_x0020_date,

    If(SortDescending1,Descending,Ascending)

    ))

     

    with the top filter being a "pre filter' then is there a way to only return say most recent 1500 records based on create_x0020_date ?

     

    and  thanks for blog post will take a look

  • WarrenBelz Profile Picture
    154,413 Most Valuable Professional on at

    Hi @cheezy ,

    Something like this should do it

    With(
     {
     wList:
     Sort(
     Filter(
     'Survey Responses',
     StartsWith(
     Surname,
     txtnamefilter.Text
     ) &&
     (
     Status.Value = Radio1.Selected.Value || 
     Radio1.Selected.Value = Blank()
     )
     ),
     create_x0020_date,
     Descending
     )
     },
     FirstN(
     Filter(
     wList,
     Dropdown3.Selected.Value = Blank() ||
     Dropdown3.Selected.Value in Responsibility.Value
     ),
     1500
     )
    )

     

    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

  • cheezy Profile Picture
    148 on at

    thanks for all your help -  this works 

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
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard