April 19, 2024

PowerApps beating the 2000 Limit

Our Current Inventory System has over 2000 items stored in a SharePoint list. Problems of course started to arise with the search functionality as soon as we went over the 2000 limit.

Two Solutions – Solution 1 – Split and Merge into a New Collection

The Inventory is divided into several Categories of Item, the largest being Metals with over 500 Items. Removing this Category to a separate SharePoint list would solve the problem but that would create difficulties with Search.

OnStart (Create 2 Collections)

ClearCollect(OurStock,ShowColumns(CurrentInventory,”ID”,”Item_x0020_Number”,”Item_x0020_Description”,”Category”, “SubCat”));

ClearCollect(OurMetal,ShowColumns(Metaals,”ID”,”Item_x0020_Number”,”Item_x0020_Description”,”Category”, “SubCat”));

Merge the 2 Collections into a Third Collection

ClearCollect(FullStock, OurStock, OurMetal)

Solution 2 – Merge into a New Collection

OnStart (Create 2 Collections) one in Ascending order the other in Descending order.

Concurrent(

ClearCollect( colInvent1, Sort(CurrentInventory, ID, Ascending) ),

ClearCollect( colInvent2, Sort( CurrentInventory , ID, Descending) ) );

Remove the Duplicates

ClearCollect( ( colInvent , ( colInvent1 , Filter( ( colInvent2 , Not(ID in ( colInvent1 .ID)) );