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:
XML
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetListItemChangesSinceToken xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>Payers</listName>
<viewName></viewName>
<query>
<query>
<Where>
<Eq>
<FieldRef Name="Title"></FieldRef>
<Value type="Text">BCBS</Value>
</Eq>
</Where>
</query>
</query>
<viewFields>
<FieldRef Name="Title"></FieldRef>
</viewFields>
<rowLimit></rowLimit>
<queryOptions></queryOptions>
</GetListItemChangesSinceToken>
</soap:Body>
</soap:Envelope>

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,
Danila
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>