This project has moved and is read-only. For the latest updates, please go here.

Can I get the list's count?

Oct 21, 2013 at 4:37 PM
Edited Oct 21, 2013 at 4:38 PM
I want only to get the number of the items in the list without anything of item,what should I do ?
Oct 21, 2013 at 4:42 PM
You can call GetList and grab the value of the ItemCount attribute.

Nov 7, 2013 at 7:31 PM
I've been trying to get the ItemCount as well and I'm running into several issues. I'm using the 2013.01 release along with jQuery 1.9.1.

What I find strange is that responseXML is undefined but I have all the XML text in responseText. No matter what i try, rs:data, z:row, etc. I get undefined and/or NaN. I've searched and searched and tried all the standard solutions.

If I debug my code, I can clearly see:

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd=""><soap:Body><GetListItemsResponse xmlns=""><GetListItemsResult><listitems xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
<rs:data ItemCount="11">
<z:row ows_Key='chance-4cb1d86d-c9fe-4275-a566-9feff412ab43' ows_Docum......

So I know I'm getting data back. I just can't get the value ItemCount. Anything else I can try?

Nov 7, 2013 at 7:45 PM
As noted on the home page here, jQuery 1.9.x don't work with SPServices. Both of those version have bugs. Switch to 1.10.2.

You're calling GetListItems rather than GetList. If you call GetList, you don't need to pull back all of the items to know how many there are.

Nov 8, 2013 at 11:11 AM
Thanks Marc. I did not notice that on the home page; I was too focused on the errors. Looking at it now, I don't know how I missed it.