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 / PowerApps Delegation i...
Power Apps
Unanswered

PowerApps Delegation issue using With()

(0) ShareShare
ReportReport
Posted on by 105
I have a gallery that is displaying projects with a handful of different filters. I have a With() statement that i have within this gallery which i originally was hoping would go around the 2000 records limit. I just hit 2000 projects within the SharePoint table. I can understand if no filters are applied that it may not display more than 2000 but i thought if filters were applied it would "pre-filter" and display what was filtered on even if it is past the 2000 record limit.
 
Any help with this would be appreciated. As well i wondered if i hold the load of the gallery data till after at least one filter is selected would this help with performance?
 
@WarrenBelz i believe you helped me originally with this With() statement, if you have any opinions, thanks. 
 
With(
   {
      wProject:
      Filter(
         tblProject_Team_Alignment, 
         Len(cmbWorkingGroup.Selected.Result) = 0 ||
         Primary_Working_Group.Value = cmbWorkingGroup.Selected.Result
      ).'Project#',
      wData:
      Filter(
         tblProjects,
         (
            Toggle1.Value ||
            (
               Len(Portfolio_Status.Value) = 0 ||
               Portfolio_Status.Value = "Active"
            ) 
         ) &&
         (
            Len('txtProject#'.Text) = 0 || 
            'Project#' = 'txtProject#'.Text
         ) &&
         (
            Len(cmbOpportunityType.Selected.Value) = 0 || 
            Opportunity_Type.Value = cmbOpportunityType.Selected.Value
         )
      )
   },
   Filter(
      wData,
      'Project#' in wProject &&
      (   
         Len(cmbProjectOwner_1.Selected.Result) = 0 ||
         Project_Owner.DisplayName in cmbProjectOwner_1.SelectedItems
      )
   )
)
 
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,534 Most Valuable Professional on at
    Hi  SMurphy
    Firstly although With() is a highly useful tool that will get you out of a whole pile of issues, it is not a total Delegation "magic bullet". It effectively creates a (very) temporary variable, the output of which is the processed "locally" on the device, kicking in the Data Row Limit restriction. The input can be of any size if a Delegable query is run to produce this Variable. So in this case: -
    With(
       {
          wProject:
          Filter(
             tblProject_Team_Alignment, 
             Len(cmbWorkingGroup.Selected.Result) = 0 ||
             Primary_Working_Group.Value = cmbWorkingGroup.Selected.Result
          ).'Project#',
    tblProject_Team_Alignment can be of any size, but wProject is limited to 2,000 records. The same goes for wData. If you want the newest 2,000 records for the first one
    With(
       {
          wProject:
          Sort(
             Filter(
                tblProject_Team_Alignment, 
                Len(cmbWorkingGroup.Selected.Result) = 0 ||
                Primary_Working_Group.Value = cmbWorkingGroup.Selected.Result,
                'Project#'
             ),
             ID,
             SortOrder.Descending
          ),
     
    I think a lot of people would wish your assumption to be true as it would remove one of SharePoint's main Delegation issues.
    Is this what you are asking ?
     
    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    Buy me a coffee

     
  • SMurphy Profile Picture
    105 on at
    Hi, thank you for your response. This certainly helps me understand the With() function more though any help with a new solution that would solve the delegation issue would be greatly appreciated. Thanks. 
  • SMurphy Profile Picture
    105 on at
    I did end up creating some collections OnVisible and replaced the tables in the With() statement with the collections, i just wonder if this is the most efficient way to do this for the best performance? 
     
    With(
       {
          _Low: 
          Sort(
             tblProjects,
             ID
          ),
          _High: 
          Sort(
             tblProjects,
             ID,
             Descending
          )
       },
       ClearCollect(
          colProjects,
          _Low,
          Filter(
             _High,
             !(ID in _Low.ID)
          )
       )
    );
    With(
       {
          _Low: 
          Sort(
             tblProject_Team_Alignment,
             ID
          ),
          _High: 
          Sort(
             tblProject_Team_Alignment,
             ID,
             Descending
          )
       },
       ClearCollect(
          colProject_Team_Alignment,
          _Low,
          Filter(
             _High,
             !(ID in _Low.ID)
          )
       )
    )
     
  • WarrenBelz Profile Picture
    154,534 Most Valuable Professional on at
    That will get you up to 4,000 records to play with but bear in mind that if you change any record, you will need to either recollect or patch the collection also (or you will not see the current version of the particular record). Also what are you going to do if the record set gets over 4K.
    There are some Delegation issues that cannot be completely "solved", particularly as your data gets bigger, however I have yet to find one that I could not find an acceptable result, generally using a Delegable "pre-filter" on another field (date range is a common one I use).

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 525 Most Valuable Professional

#2
Haque Profile Picture

Haque 273

#3
Kalathiya Profile Picture

Kalathiya 232 Super User 2026 Season 1

Last 30 days Overall leaderboard