Share via


Sharepoint 2013 REST api 100 item limit

Question

Tuesday, November 7, 2017 2:03 PM

Hello,

I have some cascading forms in a Sharepoint site that works just fine.

I took the idea from http://www.markrackley.net/2017/03/06/new-improved-cascading-dropdowns-for-sharepoint-classic-forms/#comment-17685

The issue is the dropdowns are limited to 100 items. My list contains about 200.

Is there any way to amend the below code (presume that is where the amendment needs to happen!) to unconstrain the number of items called?

            url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('"+params.childList+
                "')/items?$select=Id,"+params.childLookupField+","+params.parentFieldInChildList+
                "/Id&$expand="+params.parentFieldInChildList+"/Id&$filter="+params.parentFieldInChildList+
                "/Id eq "+ parentID+"&$orderby=" + params.childLookupField,
            type: "GET",
            dataType: "json",
            headers: {
                Accept: "application/json;odata=verbose"

Thanks

All replies (6)

Tuesday, November 7, 2017 2:23 PM | 3 votes

Hi,

100 items limit is by design. However you can add "&$top=500" to the end of the REST URL to over ride this limitation. 

 Your URL would look like below with $top appended. 

   url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('"+params.childList+
                "')/items?$select=Id,"+params.childLookupField+","+params.parentFieldInChildList+
                "/Id&$expand="+params.parentFieldInChildList+"/Id&$filter="+params.parentFieldInChildList+
                "/Id eq "+ parentID+"&$orderby=" + params.childLookupField+"&$top=500",
            type: "GET",
            dataType: "json",
            headers: {
                Accept: "application/json;odata=verbose"

Regards,

Priyan

Please Up Vote and Mark this as Answer if it helps.


Tuesday, November 7, 2017 2:24 PM

Hi,

Have you tried with $top 200 ?

Murugesa Pandian MCSA,MCSE,MCPD
Please remember to mark the replies as answers or helpful if they really helped and saved your time.


Tuesday, November 7, 2017 4:29 PM

Hi,

That is prefect thanks!

Took a while to get working.. turns out my file was cached, so no changes were pulling through.

Thanks again!


Tuesday, November 7, 2017 4:33 PM

Hi, You may mark the helpful post as answer so that others facing the same issue will find it useful Regards, Priyan

Please Up Vote and Mark this as Answer if it helps.


Thursday, November 9, 2017 8:30 AM

Hi,

If Priyan's reply is helpful to you, you can click mark as answer. It will make others who meet the same issue find answer in this thread easily.

Thanks,

Dean Wang

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected]


Monday, November 13, 2017 6:00 PM

Hi,

If you have resolved the issue,you may close the thread by marking the helpful post as an answer so that users facing similar issue will find it useful. 

Regards,

Priyan

Please Up Vote and Mark this as Answer if it helps.