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, AddColumns and...
Power Apps
Answered

Filter, AddColumns and Delegation

(0) ShareShare
ReportReport
Posted on by 114

I'm trying to join 2 lists and filter where there are no matches.

 

Currently I'm doing this below.  I'm expecting 400 rows, but I'm getting 50.  I suspect it has something to do with delegation?

 

Snag_152cf5.png

Since Filter and AddColumns are delegable, shouldn't this work?

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

    Hi @BenMunk ,

    I would suspect it has everything to do with Delegation, AddColumns is a "hidden" Delegation as it will only act on and return records up to your Delegation limit and the Relational Lookup to the other list is also not Delegable (SharePoint is not a Relational Database). If you had some sort of "pre-filter" on list A to get the numbers under 2000 records, it is doable.

     

    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

  • BenMunk Profile Picture
    114 on at

    Thanks Warren,

     

    SharePointListB has 10,000 rows.  

     

    I thought since AddColumns was wrapped in Filter...  

     

    Delegate AddColumns function > Sharepoint creates "temp table" with 10,000 rows > Filter function runs on "temp table" > Sharepoint Returns records up to the 2000 delegation limit.

     

    How does it actually work?

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

    Hi @BenMunk ,

    Firstly, can you please post any code in Text as well - saves responders a lot of typing.

    I updated my post while you were responding, but to answer your question the filter is not Delegable  - a Lookup to another list is relational and SharePoint will not accept Delegation on relational queries. Also using your logic, the maximum "temp table" you can return to process "locally" (this applies to the With() function as well) is your Delegation limit. As I mentioned, if you can "pre-filter List A with something Delegable it can be done. Another possibility is if the Newest 2,000 records will do the job. - note below I must query your ID filter as it is suggesting the ID in List A and List B are the same.

    With(
     {
     wList:
     Sort(
     SharePointListA,
     ID,
     Descending
     ),
     wListB:SharePointListB
     },
     ClearCollect(
     colTemp(
     AddColumns(
     wList,
     "Reports_ID",
     LookUp(
     wListB,
     ID = wList.ID && ReportsID = Blank()
     )
     )
     )
     )
    )

     

    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

     

  • BenMunk Profile Picture
    114 on at

    Thanks so much for your detailed response.

    re: Posting code:   noted.  thanks.

  • CMOLINAV Profile Picture
    108 on at

    Hello Warren,

     

    You say that if you pre-filter with something delegable it will be ok, but I don't see how to do it. For example, on a gallery:

     

    With(
    {
    wList: listSharepoint
    };
    Filter(listSharepoint;Field="MOLINA")
    )

     

    That returns me only the limite delegable configured on PowerApps. If I configure on 1 to test, it is retrieve me 1 record.

     

     

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

    @CMOLINAV ,

    With() is subject to Delegation limits on the output, so if you set you limit to 1, it will return one record. However setting your limit back to 500 (or whatever) and doing something like this

    With(
     wList:
     Filter(
     SPList(
     Field = "MOLINA"
     )
     },
     Search(
     wList,
     SearchBox.Text,
     "Title",
     "OtherField"
     )
    )

    and you have 2,000 records, will allow up to 500 of these (where field is MOLINA) to be then searched (a non-Delegable filer) whereas

    Search(
     Filter(
     SPList(
     Field = "MOLINA"
     )
     },
     SearchBox.Text,
     "Title",
     "OtherField"
    )

    is not Delegable and you could only address the first 500 records of the list with it,

     

    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

  • CMOLINAV Profile Picture
    108 on at

    Hello Warren,

     

    I think I understand you after read your blog and your answer.

     

    Even if I previously used a delegable function (Filter), if later I use a non-delegable function, the result is non-delegable and could be wrong according delegation limit. For example Filter+AddColumns or Filter+Search…

     

    But If I use before With+Filter and I make sure that the filter always returns less than the delegation limit (500-2000), I could use non-delegable functions without worry, the data will be correct, for example:

     

     

    With(
     wList:
     Filter(
     )
    // I have to make sure that Filter returns less than the delegation limit (500-2000)
    
     },
     Search / Add Columns /...(
     wList,
     ...
     )
    )

     

     

    Please tell me if my conclusions are correct.

     

    Many thanks for your help and contributions to the community!!!

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

    @CMOLINAV ,

    Correct - actually Delegation does not come into play at all as the With() statement returns a Table Variable (call it a collection if you want to) and the subsequent actions are performed "client-side" or locally  and there are no further calls to the data source, so you can use any valid filter/lookup you want to and it will work fine.

  • CMOLINAV Profile Picture
    108 on at

    Many thanks!!!

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard