cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PhilD
Level 8

ClearCollect always limited to the value set in app settings

I have a SharePoint list data source named 'Goals'.

File > App settings > Experimental features > Set how many rows are retrieved... > Value = 2

 

A gallery filter like this returns all records (578) to the gallery:

Filter(Goals,ItemType = "Organizational Goal",AlignedWith = GalleryFocuses.Selected.Title)

No delegation warnings so all items are returned.

 

Collecting the records like this returns 2 items in collection:

ClearCollect(colGoals,Goals)

No filter or anything but only 2 items are returned.

 

Is this the expected behavior? If I change the value in app settings to 3, the collection returns 3 items and the gallery filter is unaffected demonstrating the collection is limited to the number in the settings.

 

I set the number in app settings low so anything affected by delegation would be obvious but I didn't expect that it would put a hard limit on the size of a collection.

 

I'd like to be able to filter gallery views by a SharePoint lookup column but this make the query non-delegated, both in a collection or a direct connect to the list. Tt seems that it is mostly impossible to return all of the records with lookup column value "A" from a list with over 2000 items.

 

PowerApps and SharePoint seems to be a good combination for building a proof of concept but in practice it is mostly unusable for all but the most simple, form-like "applications".

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: ClearCollect always limited to the value set in app settings

@PhilD

Collect and ClearCollect are not delegable functions and that is why they are only returning the non-delegable row limit you have set in the experimental feature. Filter and "=" are both delegable in SharePoint and that is why you get the 578 records even though the non-delegable row limit was set to 2.

 

Hopefully they will continue to improve on delegation with SharePoint because it is limting when you want to filter on complex field types and you have a decent size list.

 

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: ClearCollect always limited to the value set in app settings

@PhilD

Collect and ClearCollect are not delegable functions and that is why they are only returning the non-delegable row limit you have set in the experimental feature. Filter and "=" are both delegable in SharePoint and that is why you get the 578 records even though the non-delegable row limit was set to 2.

 

Hopefully they will continue to improve on delegation with SharePoint because it is limting when you want to filter on complex field types and you have a decent size list.

 

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

PhilD
Level 8

Re: ClearCollect always limited to the value set in app settings

Thanks Jeff.

So in order to retrieve items filtered by both a lookup and a text column I have first collected the records by the text column (type) and then filter those collections in the gallery by the lookup column (alignment). This seems to effectively chunk out the delegable query but the performance is not very good. I guess it is just not designed to display that many records but this is what I have.

PhilD
Level 8

Re: ClearCollect always limited to the value set in app settings

If only I could delegate the lookup column part of my query to SharePoint life would be so good!
PhilD
Level 8

Re: ClearCollect always limited to the value set in app settings

@Jeff_Thorpe

I think I have my head around this a bit better now. From the way this answer is worded, I initially interpreted "ClearCollect is a non-delegatable function" to mean that with the app item limit set to "5" ClearCollect would only ever evaluate the first 5 records in the source and return those that qualified (classic non-delegated behavior). This does not seem to be the case however. If I use ClearCollect, using only delegatable query statements, ClearCollect  evaluates all the records but then returns just the first 5 qualifying results (delegated behavior). This is an important distinction for anyone reading this as these two interpretations have dramatically different implications.

 

For example, to test this I have a list containing 620 items, each with a plain text column named "type". Mixed among the 620 there are 30 records in the list that are "Type A", some at the beginning and some at the end of the list. With the app item limit set to 30, using ClearCollect I can retrieve all 30 by saying:

 

ClearCollect(colMyCollection,Filter(MyData,Type = "A")

 

In the above example, if I introduce a non-delegatable statement into the ClearCollect query, only the first 30 records are evaluated (non-delegatable behavior) only those qualifying results that fall into the first 30 records are returned (so if the first Type A is records number 31, no results are returned).

 

This means that in theory, if my list had 10,000 items, I could collect the first 2000 Type A's (wherever they appeared in the list), the first 2000 Type B's (wherever they appeared in the list), the first 2000 Type C's (wherever they appeared in the list), etc. which is very different conceptually than if each of these ClearCollect statements only evaluated the first 2000 records and returning qualifying results from that set.

 

Obviously there are performance thresholds that would apply making this approach less desirable but in some circumstances (i.e. where updating is infrequent) this may be useful.

 

Not an earth shattering revelation I guess but writing this down helped me understand the behavior more so I thought this might also help someone else.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 389 members 4,445 guests
Please welcome our newest community members: