Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to do paging on a document library (also trying this on a list) with SP 2013 using REST/OData but I can't seem to get the skipping of items working.

Here are some examples of URLs that I'm trying on my own SP 2013 farm and it also doesn't work on my Office 365 2013 Dev Preview farm. Results are returned and $top and $orderby work fine but it never skips any items. i.e. I can take the $skip out of the URL and I get the same result.

http://sp15/_api/web/lists/GetByTitle('FAQ')/Items?$skip=2&$top=2&$orderby=ID
http://sp15/_api/web/lists/GetByTitle('FAQ')/Items?$skip=2
http://sp15/_api/web/lists/GetByTitle('FAQ')/Items?$skip=2&$top=2

http://sp15/_api/web/lists/GetByTitle('Documents')/Items?$skip=2&$top=2&$orderby=ID
http://sp15/_api/web/lists/GetByTitle('Documents')/Items?$skip=2&$top=2&$orderby=ID desc

etc.

Any ideas on what I'm doing wrong?

share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

I'm not that familiar with REST but try the old syntax: Example: *http://sp15/_vti_bin/ListData.svc/FAQ?$skip=4&$top=2*

share|improve this answer
add comment

The $skip parameter does not work in SharePoint 2013 for list items. It only works for collection of data (like list collections, ecc..). See my comment at the end of this article: http://msdn.microsoft.com/library/d4b5c277-ed50-420c-8a9b-860342284b72.aspx

share|improve this answer
add comment

I see the same issue on SP2013 online with the new OData V3 _api endpoint. For CRUD operation it might be better to use the OData v2 listdata.svc endpoint for the time being.

share|improve this answer
1  
Paging sounds like something that will be added to the _api endpoint at somepoint soon - I'd go with this solution but make sure you pattern it in such a way so that you can swap out with code that DOES run on _api when that capability is added, it'll keep your code current and fully supported/upgradeable for vNext. –  James Love Nov 17 '12 at 22:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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