List Size

May 13, 2014 at 1:55 PM
Does anyone know of a way to get the size of a list using SPServices?
Coordinator
May 13, 2014 at 2:08 PM
Size meaning what? Number of items? Bytes?

M.
May 13, 2014 at 2:35 PM
Edited May 13, 2014 at 2:59 PM
Bytes, I have done this for the document libraries but I don't see any way to get the size in bytes for lists or list items. Trying to discover where the most space is being used accross a site collection.
Coordinator
May 13, 2014 at 4:46 PM
I would assume with a Document Library that you simply looped through the items and added up to byte counts? I think you could do something similar with a list, but there you would probably be more interested in the attachment sizes.

M.
May 14, 2014 at 2:11 PM
I may be missing something here but have you tried https://domain/sites/sitename/_layouts/storman.aspx at the site collection top level? It has selectors for document libraries, lists, and individual documents for the entire site collection.

Geoff
May 14, 2014 at 2:34 PM
Edited May 14, 2014 at 2:36 PM
Marc, you are correct that is how I am getting the document library sizes. The issue is that the size field isn't available if you specify a list. Code sample below.
$(document).ready(function() {
  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Tasks",
    CAMLViewFields: "<ViewFields><FieldRef Name='FileSizeDisplay' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var liHtml = "<li>" + $(this).attr("ows_FileSizeDisplay") + "</li>";
        $("#tasksUL").append(liHtml);
      });
    }
  });
});
I think the real problem I am having is finding documtation on what attributes are available for the operation I am using. I found this blog http://purbayubudi.wordpress.com/2009/08/01/using-sharepoints-getlistcollection/ which helped a lot for GetListCollection but I can't find other list of available attributes for other operations. You would think Microsoft would have this somewhere on there site.

Geoff, storman only displays up to 100 lists and we have thousands so that is not an option. Plus it is missing additional fields liked who and when it was created.
May 14, 2014 at 2:47 PM
Marc, I just noticed you mentioned attachments and most of the lists in the site collection do not have any. I am looking for the overall size of a list, just like in storman as Geoff mentioned but I need the ability to add additional fields and display more than 100 lists.