SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently making a call to GetListItems and I'm curious if there is any way to both page results and get the total number of records available?

Here is what I am passing in my call to lists.asmx:

var xmlData = "<soap:Envelope xmlns:soap='' xmlns:xsi='' xmlns:xsd=''>" +
                       "<soap:Body>" +
                        "<GetListItems xmlns=''>" +
                            "<listName>Planning Road Names</listName>" +
                            "<query>" +
                                "<Query xmlns=''>" +
                                    "<OrderBy>" +
                                        "<FieldRef Name='Title' />" +
                                    "</OrderBy>" +
                                "</Query>" +
                            "</query>" +
                            "<viewFields>" +
                                "<ViewFields xmlns=''  />" +
                            "</viewFields>" +
                            "<queryOptions>" +
                                "<QueryOptions xmlns='' />" +
                            "</queryOptions>" +
                        "</GetListItems>" +
                      "</soap:Body>" +

I looked on the documentation page and it sounds like the web service will automatically page the results for you:

Paging - A string that contains data needed to support paging, including a ListItemCollectionPositionNext attribute. If left empty, the list items returned start from the beginning of the list. Client applications should supply the value of a server-supplied bookmark. The server returns the next page of data based on the bookmark supplied. This element is optional, and its default value is an empty string.

But I can't find a way to get the total number of records available. Can this be done?

share|improve this question
up vote 0 down vote accepted

This question has been repeated several times at several places and the answer is there is no straightforward way to figure out how many total records are available and hence figure out how many pages in total. the most educated guess is that this is due to performance reasons.

Check out this thread (I am sure you can find many others):

share|improve this answer

Use SVC to get count


share|improve this answer

Your Answer


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.