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

CAML query in SPGetListItemsJson are ignored

Mar 6, 2014 at 6:48 PM
Hi There,
I just started using the latest version of spservices. I have SharePoint 2010. When I do a call to a list with no CAMLQuery variable it works. If add a simple CAML query such as: '<query><Where><Eq><FieldRef Name="Title" /><Value type="Text">BCBS</Value></Eq></Where></query>' it does not pull any entry. I have noticed from console debug in Firefox that the generated posts looks like this:
<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
<GetListItemChangesSinceToken xmlns="">
<FieldRef Name="Title"></FieldRef>
<Value type="Text">BCBS</Value>
<FieldRef Name="Title"></FieldRef>

Note how the xml has 2 <query><query></query></query> nodes on it. I have tries changing my CAML query to: '<Where><Eq><FieldRef Name="Title" /><Value type="Text">BCBS</Value></Eq></Where>' but if I do that, I get a syntax error. Am I the first to experience this? Any insight? I am using the '2014.01' release.

Thanks a lot for your help,
Mar 7, 2014 at 5:36 PM
Having the 2 <query> tags are ok... but... The one you define on input to SPServices, I think, needs to be <Query> (upper case Q). So your query should be:
<Query><Where><Eq><FieldRef Name="Title" /><Value type="Text">BCBS</Value></Eq></Where></Query>