দ্রুত এবং সহজ: SharePoint REST কল শুধু রিটার্নস 100 রেকর্ডস

I’ve been working on a public facing web site for my SharePoint practice here in New York and it uses a lot of JavaScript and REST calls to show content.

During mainline development, I create a small dataset with just 10 or so rows in a custom list and my REST calls all pulled from there.  Once I bumped up the list to have a few hundred rows of data to test for anticipated growth, I found that I was getting exactly 100 rows returned back on my REST calls.

This is a very simple thing to address.  আমার কেস (and I believe in most cases), the default REST calls to SharePoint (and possibly as an industry standard?) প্রত্যাবর্তন 100 rows.  To return more than the default, use the $top parameter on your call, যেমন:

GET /Insights Dev/_api/web/lists/GetByTitle(‘MockBlog’)/আইটেম?$select=ID,শিরোনাম,Categories/Title,Blog_x0020_Author/Title,DatePublished,BlogSummary&$expand=Blog_x0020_Author,Categories&$filter=&$top=9999

I picked 9999 in this case since I know that growth-wise, there won’t be more than 200 or so rows added to this list in a year.  If it becomes ungainly, we can implement some paging down the road.

</শেষ>

undefinedআমার ব্লগ এর জন্য সাবস্ক্রাইব করুন.

টুইটারে আমার অনুসরণ http://www.twitter.com/pagalvin

2 চিন্তা "দ্রুত এবং সহজ: SharePoint REST কল শুধু রিটার্নস 100 রেকর্ডস

  1. Ashish Patel

    Recently, I came to know that if ClientData.svc truncates the records and sends only 100 records, it includes __next property, the value of which includes URL for the next set of items. Technically, a loop can be written which looks for this property and fetch all required data by making multiple calls. What’s your thoughts on that?

  2. ক্রিস

    ধন্যবাদ. This saved my butt. Please mention that the top has to be at the end, or at least after the select and filter (at least for me it did). I fought it for a good couple of hours til I saw it on your blog, put it at the end and it worked. SP- 2013 enterprise.
    thanks again,
    ক্রিস

সাইফুল আলম চৌধুরী

আপনার ইমেইল ঠিকানা প্রচার করা হবে না. প্রয়োজনীয় ক্ষেত্রগুলি চিহ্নিত করা আছে *