How to overcome 500 items limit in PowerApps
Power Apps by default has a limitation of 500 items per data source (SharePoint, CDS, etc.), for some business apps this limitation could be a headache.
BUT! there is a solution 🙂
First of all we can change the limitation from 500 items to 2000 items…
Open your app in edit mode, click on “File”, “Settings” and then on “Advanced Settings”. Change the limitation from 500 to 2000 (it’s the maximum value that you can set).
I’m sure that you need more!!!
Yes, you can have more results. Just follow this steps:
- Filter your source results for less than 2000 items. How? with Filter function:
Filter(BigList, Section = “Section 1”)
Where BigList should be your source, Section the field that you would like to filter and “Section 1” the filter value. - With the use of filter, are you sure that you will return less than 2000 items? No, so i suggest to check the results and Notify the user that he didn’t get all the results from the Source.
- UpdateContext({CountR: CountRows(BigList)});
You will set in local variable the total rows that your source returned. - If(CountR > 1999, Notify(“More than 2000 Records”, NotificationType.Error));
You will check your local variable and if the number is more than 1999 items, then you have reached the limit and you have to inform your user. - After the filtering of your source we should take it locally to PowerApps and create a Collection in order to add the results and append each result set to that collection
Collect(BigListCollection, Filter(BigList, Section = “Section 1”));
Collect(BigListCollection, Filter(BigList, Section = “Section 2”));
Collect(BigListCollection, Filter(BigList, Section = “Section 3”));
Collect(BigListCollection, Filter(BigList, Section = “Section 4”));
Collect(BigListCollection, Filter(BigList, Section = “Section 5”));
- UpdateContext({CountR: CountRows(BigList)});
The completed code is:
UpdateContext({CountR: CountRows(BigList)});
If(CountR > 1999, Notify(“More than 2000 Records”, NotificationType.Error));
Collect(BigListCollection, Filter(BigList, Section = “Section 1”));
Collect(BigListCollection, Filter(BigList, Section = “Section 2”));
Collect(BigListCollection, Filter(BigList, Section = “Section 3”));
Collect(BigListCollection, Filter(BigList, Section = “Section 4”));
Collect(BigListCollection, Filter(BigList, Section = “Section 5”));