cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pwrappr01
Helper V
Helper V

How can I efficiently load 10,000 items from a SharePoint List into a Collection?

I have a large SharePoint List that stores over 10,000 items. I want to load all 10,000 into a collection for use in a drop-down list.

 

I would much prefer to be able to filter the choices in the drop-down by pulling directly from the Source List, but I keep running into delegation issues and am only able to see the first few items.

 

The Collection is going to be filtered by other drop-downs, so the final lists will be somewhat manageable, but I need a way to load all of the data so users are not missing items.

 

 

27 REPLIES 27

@yashag2255,

 

I just noticed that the ListItems collection includes some duplicates that need to be removed. How can I correct this? Here is the code I modified based on our previous discussion:

 

ClearCollect(LoopCount,FirstN([0, 2000, 4000, 6000, 8000, 10000, 12000],RoundUp(First(Sort('Item Tracker',ID,Descending)).ID/2000,0)));

Clear(ListItems);
ForAll(LoopCount,Collect(ListItems,Filter('Item Tracker',ID > Value)));

@pwrappr01  Do you have duplicates in your SP list or is it getting collected inside the collection?

@yashag2255,

 

I just verified my SP List to ensure there were no duplicates there.

Rens_
Frequent Visitor


@pwrappr01 wrote:

@yashag2255,

 

I just noticed that the ListItems collection includes some duplicates that need to be removed. How can I correct this? Here is the code I modified based on our previous discussion:

 

ClearCollect(LoopCount,FirstN([0, 2000, 4000, 6000, 8000, 10000, 12000],RoundUp(First(Sort('Item Tracker',ID,Descending)).ID/2000,0)));

Clear(ListItems);
ForAll(LoopCount,Collect(ListItems,Filter('Item Tracker',ID > Value)));


 

Thanks for your solution. 

For SharePoint this seems to be working, but it isn't for Excel.

 

 

is it still working? ID is giving delegation warning now and count limited to 2000.

Odiseo55
Frequent Visitor

I don't know what I'm doing wrong, but it didn't work, I only managed to get 2000 item ...

 

Put the code in App-Onstart: 

 

ClearCollect(loopC,FirstN([0,2000,4000,6000,8000,10000,12000,14000,16000],
RoundUp(First(Sort(ShipToList,ID,Descending)).ID/2000,0)));

Clear(ItemShipTo);
ForAll(loopC, Collect(ItemShipTo, Filter(ShipToList, ID > Value)));

 

Your help please!

 

 

Anonymous
Not applicable

I am running into the same issue that @Odiseo55 is having.  Would love to hear if anyone was able to figure that out!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (80,170)