cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Zgolbarg
Helper III
Helper III

Deal with Delegation warning for more than 2000 records

Hi,

 

I have a SharePoint list with near 4000 records. i have this formula in the item property of my drop down:

 

ForAll(
Sort(
Filter(Projects,
drpClients.Selected.Value ='Client (Client0)'.Value &&
Not("closed" in Status.Value)
),
'Project Number'),

{Value: 'Project Title',
Id:ID
}
)

I set the delegation limit to 2000 but I received that warning in "In" function in the formula and it just show parts of  the result.

 

can you help me with that?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Zgolbarg 

Missed a comma in the formula.

Should be:

With({_preFilter: 
    Filter(Projects, drpClients.Selected.Value ='Client (Client0)'.Value)
   },

    ForAll(
        Sort(
            Filter(_preFilter,
                 Not("closed" in Status.Value)
            ),
           'Project Number'
        ),
        {Value: 'Project Title',
         Id:ID
        }
    )
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User
Super User

@Zgolbarg 

To be clear - you set the record limit in the app.  Your formula is not a delegable formula, so it will be limited by the first 2000 records in your datasource.

 

The In operator is not a delegable operator.  Also, the Not is not a delegable operator.

 

Please consider changing your Formula to the following:

With({_preFilter: 
    Filter(Projects, drpClients.Selected.Value ='Client (Client0)'.Value)
   },

    ForAll(
        Sort(
            Filter(_preFilter
                 Not("closed" in Status.Value)
            ),
           'Project Number'
        ),
        {Value: 'Project Title',
         Id:ID
        }
    )
)

The attempt here is to prefilter your datasource with a Delegable filter criteria and then use that as the source for the non-delegable filter.

 

Also, I assume based on your formula that the Status column is a multi-select choice column.  If it is not multi-select, then you don't need the in operator.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes 

 

Thanks for your reply.

Yes, the status is a multi-select choice column.

 

I tried your formula but I've got these errors:

in the second filter : Invalid number of arguments , received 1 expected 2 or more

in the sort : Name isn't valid(project number, ID, project Title)

 

 

 

 

RandyHayes
Super User
Super User

@Zgolbarg 

Missed a comma in the formula.

Should be:

With({_preFilter: 
    Filter(Projects, drpClients.Selected.Value ='Client (Client0)'.Value)
   },

    ForAll(
        Sort(
            Filter(_preFilter,
                 Not("closed" in Status.Value)
            ),
           'Project Number'
        ),
        {Value: 'Project Title',
         Id:ID
        }
    )
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayes 

 

Thanks a lot for your help.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,324)