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 / Handle SharePoint Dele...
Power Apps
Unanswered

Handle SharePoint Delegation Warning

(0) ShareShare
ReportReport
Posted on by 104
Hello,
 
I am stuck at a delegation warning for some time, and I can not seem to find a proper workaround for this.
I have a big transactional list in SharePoint, which will hold 2000+ items (the client didn't want to pay for Dataverse, unfortunately).
 
For this list, I have a Gallery in the app, in which I must add this filters:

As we already know it, the "in" function is not delegable. So how could I properly handle this other way?

The data row limit is 500, if I increase it any more from this, the app performance will decrease drastically.

Thank you, anything helps really!
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at
    Can you please remember to post your code in Text - saves re-typing here.
     
    Yes, the in filter is not Delegable - for the first one, this may work for you as it would seem the two value will exactly match
    With(
       {_Mail: Lower(gblUserOfficeMail)},
       SortByColumns(
          Filter( 
             eVar_COR_Finance_FAS_Budget_Monitoring,
             StartsWith(
                'Current Approver',
                _Mail
             ) ||
             StartsWith(
                'Current Substitute',
                _Mail
             )
          ),
          "YourSortColumn",
          YourSortOrder
       )
    )
    For the second one, I amnot sure what you want returned if varKPIID is not 10, but try this for a start (note also you will need the field name in colApprovedRejectedKPIs where indicated).
    SortByColumns(
       Ungroup(
          ForAll(
             colApprovedRejectedKPIs As _KPIs,
             Filter( 
                eVar_COR_Finance_FAS_Budget_Monitoring,
                varKPIID = 10 && 'Approval Request LookUp'.Value = _KPIs.YourFieldName
             )
          ),
          Value
       ),
       "YourSortColumn",
       YourSortOrder
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • taraubianca25 Profile Picture
    104 on at
     
    Thanks for you response!
     
    In the first case, StartsWith will not help, because for example:
     
    'Current Approver' might hold multiple emails : "email1@yahoo.com; email2@yahoo.com; email3@yahoo.com"
    Same with 'Current Subsitute'
    That's why I was using "in".

    In the second case, does not work to loop through all colApprovedRejectedKPIs, and then Filter the DataSource. It returns me all the values from the DataSource. 
  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at
    For the first one, that is why is it is always good to post all relevant information - I (naturally) assumed both of these fields were a single email. There is no Delegable answer using Power Apps here once you get over 2,000 items (Power Automate has possibilities, but that is a new level of complexity).
    If you want to filter the newest 2,000 (or whatever number) records, set your Data Row Limit to at least that number and do this
    With(
       {
          _Mail: Lower(gblUserOfficeMail),
          _Data:
          Sort(
             eVar_COR_Finance_FAS_Budget_Monitoring,
             ID,
             SortOrder.Descending
          )
       },   
       SortByColumns(
          Filter( 
             _Data,
             _Mail in 'Current Approver' || _Mail in 'Current Substitute'
          ),
          "YourSortColumn",
          YourSortOrder
       )
    )
    For the second one, based on what you had posted (on which I assumed colApprovedRejectedKPIs had a Text field that you were trying to match with the Lookup field 'Approval Request Lookup' in  eVar_COR_Finance_FAS_Budget_Monitoring ), then the code is correct as it is the only way to get some degree of Delegation management into looking up a one-to-many relationship. 
     
    It "loops through" colApprovedRejectedKPIs and returns all records from eVar_COR_Finance_FAS_Budget_Monitoring where the 'Approval Request Lookup'  field matches the text field in the collection (so it does a heap of Delegable queries using equals) and ForAll then creates a Table with each set in a field called Value. This is then Ungrouped to reveal the total output with all relevant fields.
     
    So I need to ask again what exactly are you comparing varKPIID with (I assume this is a Variable). Without this filter (whatever it is), the code you posted is comparing the entire list against the entire collection which is what you say you do not want to do.
     
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   

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 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard