Sharepoint 2013 REST API not returning all items for a list

后端 未结 4 950
囚心锁ツ
囚心锁ツ 2021-02-13 19:38

The title states my problem quite exactly. If I try to gather all 400+ items from a list using sharepoint\'s REST API, I only get first 100.

I have read http://msdn.micro

4条回答
  •  盖世英雄少女心
    2021-02-13 20:08

    You can use RowLimit & RowsPerPage in rest call. Below is the example

    $.ajax({
    url: siteurl + "/_api/web/lists/getbytitle('NewList')/items",
    method: "GET",
    headers: { "Accept": "application/json; odata=verbose" },
    RowLimit : null, //Specify the row limit
    RowsPerPage : null, //Specify no of rows in a page
    success: function (data) {
         $('#oDataFilter').append("");
         $.each(data.d.results, function(index, item){
             $('#oDataFilter').append("");
         });
         $('#oDataFilter').append("
    " + item.ID + ""+ item.Title + "
    "); }, error: function (error) { alert('Error getListItems :: '+JSON.stringify(error)); }

提交回复
热议问题