
Hi @Jervic Andres,
There is a 5000 items limition in SharePoint List. You can not fetch the List items more than threshold limit. Ex: you have 10,000 items, there are 3000 items which meets your filter. you may think this is less than threshold limit, so it will retrieve. but here it won't retrieve rather you will get exceed threshold limit exception. We can only retrieve all the items by ecursive call and filter the items on local.
You can do recursive call to the GetListItems()
function. Please make a reference
var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('DocumentList')/items?$top=1000";
var response = response || []; // this variable is used for storing list items
function GetListItems(){
return $.ajax({
url: url,
method: "GET",
headers: {
"Accept": "application/json; odata=verbose"
},
success: function(data){
response = response.concat(data.d.results);
if (data.d.__next) {
url = data.d.__next;
GetListItems();
}
},
error: function(error){
// error handler code goes here
}
});
}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.