Get Lists by ServerTemplate in GetListCollection operation

Sep 29, 2010 at 3:41 PM
Edited Sep 29, 2010 at 4:13 PM

Is there a way to filter the returned lists besides an $.each after the query is executed in the GetListCollection operation?

I see that the Web service wants the format as <List ServerTemplate="101", where or how would this be placed into the SPServices Query?

I tried in the CAMLQuery as such: but no dice :(

            operation: "GetListCollection",
            webURL: thisSite,
            async: false,
CAMLQuery: "<Query><Where><Eq><FieldRef Name='ServerTemplate'/><Value Type='Text'>101</Value></Eq></Where></Query>",
Sep 30, 2010 at 3:03 AM
This seems right, but obviously it isn't if you're getting an error. Did you try Type="Number"? Let me know if you're still stuck and I'll try this in my test environment. The other option would be to use a tool like the U2U CAML Builder to get the right Where clause. M.
Sep 30, 2010 at 12:35 PM

Thanks for the reply Marc. 

I have tried Type='Number' but the query still returns all the lists.  I am not receiving a specific error. It doesn't filter the lists.

concerning U2U CAML Builder, I have attempted to use it but haven't found a way to use it for getting lists, its great for items within a list.

Sep 30, 2010 at 1:05 PM

Teaches me to respond quickly from my iPhone without checking the documentation.

There's no CAMLQuery option for the GetListCollection operation, so what you're providing is ignored. you'll need to do your filtering in the jQuery.


Sep 30, 2010 at 1:24 PM

Muchos Gracias Marc! I looked at the above link before, now i understand the difference, especially after looking at the GetListItems.

The difference is in the parameters. There are no parameters for GetListCollection Web Service Method, but in the object model it is possible to filter the list by <List ServerTemplate="101". 


Again thank you Marc!