SharePoint REST API – for lists.getAll Items() limited to 100 rows

The limit is due to server-driven paging. It protects against developers inadvertently making a request that returns large result sets.

You can use $top if you really want a large result set to be returned.

This can be worked out using below


But the above is useful when you just want the counts from a list.

Lets take a scenario where you would want to iterate through the results without putting burden on the list service by checking __next. If it has a value, it contains the address that will return the next set of items. If it’s null, you’ve hit the end of the result set. Now based on that your function should be modified as Recursive function.

function callToHostWeb() {
    var message = jQuery("#message");

    var hostUrl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
    var appUrl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));

    var scriptbase = hostUrl + "/_layouts/15/";
    var url = appUrl + "/_api/SP.AppContextSite(@target)/Web/Lists/getByTitle('Order Details')/Items?$select=Title&@target='" + hostUrl + "'";
    jQuery.getScript(scriptbase + "SP.RequestExecutor.js", getOrderDetails);

    function getOrderDetails() {
        var executor = new SP.RequestExecutor(appUrl);
                url: url,
                method: "GET",
                dataType: "json",
                headers: {
                    Accept: "application/json;odata=verbose"
                success: function (data) {
                    var response = JSON.parse(data.body);
                    message.append(String.format("Retrieved {0} items", response.d.results.length));

                    if (response.d.__next) {
                        url = response.d.__next;
                error: function (data, errorCode, errorMessage) {

    function getQueryStringParameter(paramToRetrieve) {
        var params =
        var strParams = "";
        for (var i = 0; i < params.length; i = i + 1) {
            var singleParam = params[i].split("=");
            if (singleParam[0] == paramToRetrieve)
                return singleParam[1];

Thanks to below article



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s