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

CAMLQuery not filtering

May 3, 2011 at 10:36 PM

Has anyone had any issues with the CAMLQuery parameter not filtering at all? I have set up a list called maps, with 2 fields (Page [text] and Book [choice]).  I am able to use SPServices to bring back the data from the list, however, when I try to use the CAMLQuery parameter to filter, I continue to get all results back.  Maybe I am not seeing the mistake.  but my code is below.

I have tried to hard code a value into the CAMLQuery to no avail, and have also tried this on a brand new list with the same data.  I have also changed the  value type to see if that would make a different, but still continue to get back too many results.. any help would be appreciated

<script type="text/javascript">


var bookName = getParameterByName('bookName');
var preFix = "";
var folderName="";
var dfsPath = "myDFSPath"
var pageLink = "";

case 'Alabama-Florida':
case 'Carthage':
case 'Lafayette':
  preFix ='VLLA';
  alert("don't know what book");

//alert (folderName);


var camlQuery = "<Query><Where><Eq><FieldRef Name='Book'/><Value Type='Choice'>"+ bookName +"</Value></Eq></Where></Query>"

//alert(camlQuery );


//These are global variables that will be used by the query to the SharePoint list

    operation: "GetListItems",
    async: false,
    listName: "Maps",
    camlQuery: camlQuery,
    completefunc: function (xData, Status) {
      $(xData.responseXML).find("[nodeName='z:row']").each(function() {
      var pageLink = dfsPath + folderName + '/' + preFix +  $(this).attr("ows_Title") + '.pdf';
       var newTr = '<tr><td name="pageTD"><a href="' + pageLink  + '">Sheet ' + $(this).attr("ows_Title") + '</a></td></tr>';
      $('#mapsTable').append(newTr);       });


// function to return a query string paramater by the name of the parameter.

function getParameterByName(name) {

var match = RegExp('[?&]' + name + '=([^&]*)').exec(;

return match ? decodeURIComponent(match[1].replace(/\+/g, ' ')) : null;






May 4, 2011 at 1:53 AM
Edited May 4, 2011 at 1:53 AM
It's usually the little things. ;+) It's CAMLQuery, as opposed to camlQuery. Unfortunately, case matters, so jQuery is ignoring the camlQuery option, as it has no use for it.
May 14, 2011 at 4:06 AM

Thanks....that was it....