Every once in a while you find yourself looking for a solution to an unusual problem. This one started off as a much more difficult reporting problem in a system where I had very limited access. I needed to find all the user created document libraries and then get a rough document count of which ones were being used.

As in other instances when I need quick and dirty custom listings, I looked at what SPServices could offer. Looking at their wiki you can see that there are a number of List related methods and calls. https://spservices.codeplex.com/wikipage?title=Lists

The one we need is GetListCollection. This will return a collection of all lists on a site. Once we have that collection we can filter it based on the list template type. You can see that every list type has a template code and a document library is 101. So now the function that will sort through the lists on a site, find all marked as document libraries, then filter out the built in document libraries (Style Library and Site Assets).


This will output the list of document libraries and their file count to a div with the id of outputDataDiv. As a note, this function assumes you have included jQuery and SPservices on the page in question.

Like this post? Share it!