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

using a variable in CAMLQuery and ows_ problem

Jan 13, 2012 at 9:34 PM
Edited Jan 13, 2012 at 9:35 PM

I've got a getlistitems query that's almost working but I have 2 problems. Here is the code:

    operation: "GetListItems",
    async: false,
    listName: "Communications Services Request Form",
    CAMLQuery: "<Query><Where><Eq><FieldRef Name='ID' /><Value Type='Number'>51</Value></Eq></Where></Query>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var varChecked = $(this).attr("ows_CheckedOutTo");

I want to repalce the 51 in the CAML Query with a variable and the "ows_CheckedOutTo" returns as undefined, despite there being a column called "CheckedOutTo" in my list.

Thanks for the help.

Jan 13, 2012 at 9:42 PM

I sorted the variable:

CAMLQuery: "<Query><Where><Eq><FieldRef Name='ID' /><Value Type='Number'>" + varID + "</Value></Eq></Where></Query>",

Nothing on the ows_ problem, though,

Jan 13, 2012 at 10:14 PM

figured it out. That was the bevahiour I wanted, but I was getting confused.

Jan 17, 2012 at 2:33 PM

Glad you solved it. It's always nice to watch the process!