Filter list items retrived by SPServices

Mar 29, 2012 at 1:10 PM
I am trying to fetch 10 records using below code(CAMLRowLimit: 10) but still SPServices is returing all the records. Please suggest how to fetch 10 records instead of all records. Code: $().SPServices({ operation: "GetListItems", async: false, listName: "{CB450228-4E32-47DB-A5AB-115B937660A0}", CAMLViewFields: "<ViewFields>" + "<FieldRef Name='Id' />" + "<FieldRef Name='Name' />" + "</ViewFields>", CAMLRowLimit: 10, completefunc: function (xData, Status) { alert(xData.responseXML.xml); $(xData.responseXML).find("[nodeName=z\\:row]").each(function () { var id = $(this).attr("ows_Id"); var name = $(this).attr("ows_Name"); $("#tableId").html($("#tableId").html() + '
  • ' + name + '

    '); }); } });
  • Coordinator
    Mar 29, 2012 at 1:50 PM

    CAMLRowLimit should work, but it's pretty hard to read your code as you posted it. It also doesn't seem to be complete.

    M.