简体   繁体   中英

SharePoint REST API for Sharepoint online retrieving items from a list/document library which exceeds 5000 items

I have SP online list/document libraries which are going to exceed 5000 items threshold limit. I have created index columns.

Question: I have a custom form, where I will retrieve the data from the list to show up on the form. Will the rest API I am having will work or do I need to take care of anything else.

$pnp.sp.web.lists.getByTitle('ABC').items.filter("ReqID eq '" + UniqueID +'").orderById("ID").get().then(function() {

Can you please advise

Thanks, Kevin

This is list view threshold issue. For sharepoint online, you can Index Columns Used as View Filters:

Or you can make use of other pnp js methods:

在此处输入图片说明

// we can also use filter as a supported odata operation, but this will likely fail on large lists
const allItems: any[] = await sp.web.lists.getByTitle("BigList").items.select("Title").filter("Title eq 'Test'").getAll();
console.log(allItems.length);

BR

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM