0

I'm querying list properties using a REST query /_api/Web/Lists?&$select=Title,ItemCount.

ItemCount property returns current count of items but I don't see how to get the maximum allowed count for a SPList : https://msdn.microsoft.com/fr-fr/library/microsoft.sharepoint.splist_members.aspx

2 Answers 2

0

The maximum is based on you listview treshold setting. Default is it 5000 records.

2
  • You're telling me that the limit is not on the list itself but that there are 1 limit per (list)view ? This sounds strange to me. When does this value comes from when you're editing a list (=listedit.aspx) ? The threshold of which listview is used ?
    – frenchone
    Commented Mar 9, 2018 at 14:00
  • This is just a general limit of how much item there can be return in one call/view. It is a general sharepoint setting, can be changed thru central administration. Is due to avoid heavy loads.
    – M.P.
    Commented Mar 9, 2018 at 15:08
0

it looks like the property is not available by querying /_api/Web/Lists but only by querying _api/Web/Lists/SchemaXml then parsing the xml

var url  = __site  + "/_api/Web/Lists(@v0)/SchemaXml?&@v0=guid%27"+listId+"%27";
$.ajax({
    headers:{
        Accept:"application/json;odata=verbose"
    },
    url:url,
    success:function(res){
        var xmlStr = res.d.SchemaXml;
        var doc = new window.DOMParser().parseFromString(xmlStr, "text/xml");
        var xPathRes = document.evaluate ('//@MaxItemsPerThrottledOperation', doc, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
        if (xPathRes.singleNodeValue) {
            success(xPathRes.singleNodeValue.textContent);
        }                   
    },
    error:error
});

or simpler by querying /_api/Site/MaxItemsPerThrottledOperation
(thanks ghangas for this one (as found on REST API : different properties list using /_api/Web/Lists/SchemaXml VS /_api/Web/Lists/?))

So it looks like this limit is a property of the site and not per list.
Of course this property is not listed at https://msdn.microsoft.com/fr-fr/library/microsoft.sharepoint.spsite_members.aspx

Why KISS when you can go the MS way?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.