I have this code, where it should call the list item after the user has clicked on the list url.

$j('#cd-sp-lists li a').click(function(){       
    var ListGUID = $j(this).attr('title');                  
            operation: "GetListItems",
            async: false,
            listName: '' + ListGUID + '',
            CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
            completefunc: function (xData, Status) {
              $j(xData.responseXML).SPFilterNode("z:row").each(function() {
                var liHtml = "<li>" + $j(this).attr("ows_Title") + "</li>";                 
        return false;           

Now this work fine. The problem is I dont want to add the fields name manualy to this script like this: var liHtml = "<li>" + $j(this).attr("ows_Title") + "</li>" it should get all item names ,value, and colum names based on that list.

Is there away to do that?

  • You could do a GetList call first, but at some point, you'd need to specify what field/value you want to write out. Commented Apr 9, 2015 at 13:39

1 Answer 1


In that case you should first get the list fields using below service call

    operation: "GetList",
    listName: '' + ListGUID + '',
    completefunc: function(xData, Status) { 
        //Extract field names
    async: false

Inside completefunc you can have the actual call.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.