Sunday, 15 March 2015

Odata querying 100 items only issue - SharePoint

Hi Coders,
 This post will be useful for the beginners, who has already started using Odata in SharePoint 2013. You might have faced this issue or you havent figured it out yet.

For Odata queries please refer this.

So based on the above link, for retrieving items from the list , we have to use the following syntax.
http://server/site/_api/web/lists('guid')/items?$select=Title
This provides you the "Title" column value of  the items in the list.

So, the tweak in this query is, by default it returns only 100 items..
This important point has been missed in most of the documentation..


FIX : 
So to fix this we have to use the "top" clause.
http://server/site/_api/web/lists('guid')/items?$select=Title$top=10000

We have to give a maximum value based on our application nature.

Hope this helps..

Have a good day. Meet you on the next post.
Happy Sharepointing......