cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nakama
Frequent Visitor

Gallery with more than 2000 rows

Hi,

I created a canvas app for sales that start with the select customer. I stored customer information in the SharePoint list (CustomerList) and added a SharePoint list connector to bring data to power apps. Then add gallery (gallery1) to show this list in the app.

The issue now is I can not show more than 2000 rows in gallery1! Is there a solution to fix this issue.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Try modifying your filter as follows:

Filter('Sales Customer',StartsWith(Title,SearchText.Text),'Customer ID'=Value(SearchText2.Text)))​

You need to turn your SearchText2.Text into a numeric by wrapping it in a Value(...) function. I believe this is the case even if you have set your text input control format to number. 

View solution in original post

5 REPLIES 5
PaulD1
Super User
Super User

The solution is to apply a filter to your gallery. Scrolling through 2000 entries is not a good experience for users and your App will be horribly slow pulling all that data back over the network.

Force your users to put in a delegable filter - e.g. Customer Region or Customer Type so you can pull back a subset of customers that will hopefully be of a more manageable size.

Unfortunately you are using SharePoint which is not a proper database and cannot do a delegable Search for a partial customer name, but you can use StartsWith (which is delegable in SharePoint), so your form can require that the user enter the first few characters of the customer name and then only return those that match. This is far from ideal as you would want 'Paul' to find 'John Paul', 'J Paul', etc. which it won't, because it is StartsWith, but if you want to stick with SharePoint this is as good as it is going to get.

RezaDorrani
Dual Super User II
Dual Super User II

@nakama 

Delegation is the reason.

Check out my playlist on delegation which covers everything you need to know about delegation and working with large data sources. Also includes delegation workarounds..

https://www.youtube.com/playlist?list=PLTyFh-qDKAiE6ia-D94Qk5-AzpN4dqOmD

--------------------------------------------------------------------------------
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.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

v-yutliu-msft
Community Support
Community Support

Hi @nakama ,

Could you tell me

1)how many records are in your sharepoint list?

2)the formula in your gallery's Items?

As @RezaDorrani said, the key problem is delegation.

If your records number is less then 2000, you just need to change delegation limit to 2000.

delegation.jpg

 

If your records number is larger than 2000, then you need to avoid the affect of delegation.

Two solutions: 

1)only use delegate functions 

delegate functions for sharepoint list

Item Number Text Boolean DateTime Complex [1]
Filter Yes Yes Yes No [4] Yes
Sort Yes Yes Yes Yes No
SortByColumns Yes Yes Yes Yes No
Lookup Yes Yes Yes No Yes
= Yes Yes Yes No [4] Yes
<, <=,<>, >, >= Yes [2] No No No Yes
StartsWith - Yes - - Yes
IsBlank - No [3] - - No

2)save data in collection, then deal with data in collection.

In collection, there's no delegation limit.

However, when you save data in collection, you also need to use delegate function.

You need to save data to collection per 2000 records. (ID column is not delegate for "<",">")

So usually we need another number field with unique value to save data to multiple collections.

For example:

ClearCollect(collection1,Filter(list,numberfield<=2000));
ClearCollect(collection2,Filter(list,numberfield>2000,numberfield<=4000));
ClearCollect(collection3,Filter(list,numberfield>4000,numberfield<=6000));
ClearCollect(collection4,Filter(list,numberfield>6000,numberfield<=8000));
.....

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
nakama
Frequent Visitor

 

Thank you all for your feedback. After watching the @RezaDorrani  video, I tried to avoid the delegation using the start with function and working fine with me but not supporting my scenario.

My gallery contains ( Customer name and Customer ID). I added two textboxes as a filter, one for customer name, and the second for customer id as below :

Filter('Sales Customer',StartsWith(Title,SearchText.Text),'Customer ID'=SearchText2.Text))​


but I find an issue that can't compare two value one for text and second for a number!

So how can we now solve this scenario and avoid the delegation issue?

Try modifying your filter as follows:

Filter('Sales Customer',StartsWith(Title,SearchText.Text),'Customer ID'=Value(SearchText2.Text)))​

You need to turn your SearchText2.Text into a numeric by wrapping it in a Value(...) function. I believe this is the case even if you have set your text input control format to number. 

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,629)