SPservice Undefined

Isaac
Isaac used Ask the Experts™
on
Hello all,

I'm having some issues with the following code.
  <script>
  $(document).ready(function() {
    $("#tabs").tabs();
      
      $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Profiles",
    CAMLViewFields: "<ViewFields><FieldRef Name='ows_LinkTitle' /><FieldRef Name='ows_Bio' /><FieldRef Name='ows_Skillset' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var hdrHtml = "<h1>" + $(this).attr("ows_Title") + "</h1>";
            var genHtml = "<p>" + $(this).attr("ows_Bio")+ "</p>" + "<p>" + $(this).attr("ows_Skillset") + "</p>";
            alert(genHtml);
        $("#ProfileName").append(hdrHtml);
            $("#fragment-1").append(genHtml);
      });
    }
  });
      
  });

 

</script>


I am coming up with undefined for ows_Bio and ows_Skillset. I doubled checked the internal name and it comes up fine. Please help. Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Cloud Expert
Most Valuable Expert 2013
Top Expert 2014
Commented:
Shouldn't it be <FieldRef Name='Skillset' /> in <ViewFields> but $(this).attr("ows_Skillset") later? As in the "ows_" part is appended in the XML result?

There is an example here;

http://spservices.codeplex.com/discussions/274371
IsaacSharePoint Client Side Developer

Author

Commented:
Yes, you are right. I don't understand why you can't use ows in the FieldRef though. Why is that? I'm a newbie so I'm trying to understand the basics. Please enlighten me.
Jamie McAllisterCloud Expert
Most Valuable Expert 2013
Top Expert 2014

Commented:
Because that isn't the REAL internal name, it's an artifact of the web service XML returned. :)
IsaacSharePoint Client Side Developer

Author

Commented:
Ok. Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial