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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
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.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

@RandyHayes 

 

Thanks a lot for your help.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,655)