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

CAMLQuery w/ functions other than GetList

Jun 24, 2010 at 11:56 PM

Is it possible to implement a CAMLQuery on the Groups/Permissions bunch of operations?
I was planning on using the U2 CAMLQuery builder but then I got stumped on which list to Query...

My other option is probably to use a DVWP and call the webservice from there and see what the CAML look like?


Jun 25, 2010 at 2:57 AM


Sorry about that prior reply. Somehow it got encoded, so not very useful.

I've got all the available parameters for the Web Service implemented. Can you explain what you're trying to do? Maybe there's some other trick.


Jun 25, 2010 at 3:02 PM


I noticed some examples using CAML Query as an option to the following SPServices functions:
GetListItems -
cracking open the source code, I checked the implemented parameters
rows 321-327:

case "GetListItems":
				SOAPEnvelope.payload += wrapNode("listName", opt.listName);
				SOAPEnvelope.payload += wrapNode("viewName", opt.viewName);
				SOAPEnvelope.payload += wrapNode("query", opt.CAMLQuery);
				SOAPEnvelope.payload += wrapNode("viewFields", opt.CAMLViewFields);
				SOAPEnvelope.payload += wrapNode("rowLimit", opt.CAMLRowLimit);
				SOAPEnvelope.payload += wrapNode("queryOptions", opt.CAMLQueryOptions);

and how you are using the GetListItems function & CAML Query in the inner workings of the utility functions SPCascadeDropdowns, SPGetLastItemId, SPRequireUnique & SPAutocomplete.

I was thinking (and it might be my mistake) that any 'Get' operation could in theory have a CAMLQuery option?

In my specific case, I would like to use CAMLQuery for the GetGroupCollectionFromSite & GetUserCollectionFromGroup.
As I am not very familiar with CAML Queries, I am using the U2 CAMLQuery builder. Unfortunately, it only brings up List & library so I am unclear on how I would write a CAML Query for the above mentioned functions.

Hope this is more clear.
Jun 26, 2010 at 3:29 AM


Again, I’m only able to pass parameters to the Web Services that they can understand. Passing anything else is just going to throw an error.  If you look at the documentation for GetGroupCollectionFromSite & GetUserCollectionFromGroup, you’ll see that they wouldn’t understand the CAMLQuery parameter.  (You can get to the documentation at MSDN from the links next to each supported operation in the SPServices documentation.)

What you’ll want to do is to process the results from GetGroupCollectionFromSite and/or GetUserCollectionFromGroup in the completefunc. Once there, the Web Service operation results are available to you and you can parse the returned XML in any way that you’d like.