I'm trying to get Data from SP List via SOAP.

It works for standard columns like "ows_Modified". But if I try to get Data from Column I created (example: "DogNames") in the SP List by myself, it doesn't work.

Could you please take a look. It seems like I've to make some modifications

function getSharepointListData (rightList) {

   var listName = rightList;

var soapEnv =
    "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
        <soapenv:Body> \
             <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                <listName>"+listName+"</listName> \
                <viewFields> \
                    <ViewFields> \
                       <FieldRef Name='Author' /> \
                   </ViewFields> \
                </viewFields> \
            </GetListItems> \
        </soapenv:Body> \

    url: "http:URL/_vti_bin/lists.asmx",
    type: "POST",
    dataType: "xml",
    data: soapEnv,
    complete: processResult,
    contentType: "text/xml; charset=\"utf-8\""

function processResult(xData, status) {

var j = 0;
var myArray = new Array();

$(xData.responseXML).find("z\\:row").each(function() {

    //var content = $(this).attr("ows_Modified");
     var content = $(this).attr("dogNames");

   myArray[j] = content;

    $("#tasksUL").append(content + '</br>');

}); }}

Is it also possible somehow to count the columns in the list? For example to get information from Column 1, 2 ..... instead of the name.

Any help would be appreciated!!!

  • Did you try ows_dogNames?
    – Erin L
    Mar 17, 2016 at 14:40
  • Version of SharePoint? Mar 17, 2016 at 14:47
  • yes i tried with ows_dogNames. I get an Array with 12 "undefied" objects (12 rows in the list). Sharepoint 2010 Mar 17, 2016 at 14:56
  • Try including your custom field in the <ViewFields> section
    – Erin L
    Mar 17, 2016 at 15:04
  • Have you considered using SPServices? Works on SP 2010 and easier to work with. spservices.codeplex.com/documentation
    – ova
    Mar 17, 2016 at 15:32

2 Answers 2


Put this in an html file somewhere on your site and replace the SITE and listName values. Let me know what you get back.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices.min.js"></script>
SITE = "http://sharepointsite/";

$(document).ready( function(){
        webURL: SITE,
        operation: "GetListItems",
        listName: "dogNames",
        async: false,
        CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='dogNames' /></ViewFields>",
        completefunc: function(xData, Status) {
                var out = $().SPServices.SPDebugXMLHttpResult({
                node: xData.responseXML
                $("#debug").html("").append("<b>This is the output from the GetList operation:</b>" + out);

<div id="debug"></div>

I got it with SP Services. Thank you all for help!

var SITE = URL;
var myArray = new Array();
$(document).ready( function(){
        webURL: SITE,
        operation: "GetListItems",
        listName: "dogNamesList",
        async: false,
        CAMLViewFields: "<ViewFields><FieldRef Name='dogNames' /></ViewFields>",
        completefunc: function(xData, Status) {

           $(xData.responseXML).SPFilterNode("z:row").each(function() { 

                var data = ($(this).attr("ows_dogNames"));

                var j = 0;

                myArray[j] = data;




  • Since you seem to have had a lot of help of the answers here, please at least upvote them :) Mar 21, 2016 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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