i'm new to SharePoint so I might be asking something silly, or maybe doing silly mistakes, but i've looked it up all over and couldn't find a solution.

So Basically I want to access a Sharepoint list and return the values from a single column:

    <script language='javascript' type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script>
    <script language='javascript' type='text/javascript' src="http://myWebSite.com/risk/dtm/JS/jquery.SPServices-2014.01.min.js"></script>
    <script language='javascript' type='text/javascript' src="http://myWebSite.com/risk/dtm/JS/sputility.min.js"></script>
    <title>Test sharepoint</title>

    <div id='result'></div>


        var query = '<Query>'+
                                    '<FieldRef Name="Ambiente"/><Value Type="Text">SAS</Value>'+
                                    '<FieldRef Name="IsOldRequest"/><Value Type="Text">Y</Value>'+

        var view = '<ViewFields>'+
                    '<FieldRef Name="Title" />'+
        var htmlTable='';
        var TrainingTitle;
        var RequestStatus;
        var Created;
        var RequestorName;
        var Deployement;
                    operation: "GetListItems",
                    async: false,
                    webURL: 'http://myWebSiteSharepoint.com.br/risk/dtm/gd/Lists/grupos/AllItems.aspx?ShowInGrid=True&View=%7BEC1106D7%2DDCD4%2D4425%2DBC49%2DFEDCCD55AF8A%7D&InitialTabId=Ribbon%2EList&VisibilityContext=WSSTabPersistence',
                    listName: "Grupos e RDOs",
                    CAMLViewFields: view ,
                    CAMLQuery : query ,
                    completefunc: function (xData, Status) {
                        var totalRows = parseInt($(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount"));
                        if(totalRows > 0)
                                TrainingTitle = $(this).attr("ows_TrainingTitle");
                                if(TrainingTitle === undefined)
                                    TrainingTitle = '';

                                RequestStatus = $(this).attr("ows_RequestStatus");
                                if(RequestStatus === undefined)
                                    RequestStatus ='';

                                Created = $(this).attr("ows_Created");
                                if(Created === undefined)
                                    Created ='';

                                RequestorName = $(this).attr("ows_RequestorName");
                                if(RequestorName === undefined)
                                    RequestorName= '';

                                Deployement = $(this).attr("DeployementDate");
                                if(Deployement === undefined)
                                    Deployement ='';
                // Store data in variable once all data in stored append it to table                    
                                htmlTable+="<tr><td>"+RequestStatus +"</td><td>"+TrainingTitle +"</td><td>"+Created+"</td><td>"
                                            +RequestorName +"</td><td>"+ Deployement +"</td></tr>";                                 

                            console.log("rows less than 0");

So, with my console.logs I got the following results:

xData: full javascript object, with 200 status and the following responseText:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns:o="urn:schemas-microsoft-com:office:office" lang="pt-br" dir="ltr">
<head><meta http-equiv="X-UA-Compatible" content="IE=8" /><meta name="GENERATOR" content="Microsoft SharePoint" /><meta name="progid" content="SharePoint.WebPartPage.Document" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Expires" content="0" /><title>
    Grupos e RDOs - Todos os Itens
</title><link rel="stylesheet" type="text/css" href="/risk/dtm/gestaodedados/_themes/1/search-EB0BE372.css?ctag=2"/>
<link rel="stylesheet" type="text/css" href="/risk/dtm/gestaodedados/_themes/1/corev4-AB0302A5.css?ctag=2"/>

    <script type="text/javascript">
    var _fV4UI = true;
    <script type="text/javascript">
// <![CDATA[
document.write('<script type="text/javascript" src="/_layouts/1046/init.js?rev=M1qgSOO%2Bkv9U8HtiTmhOpg%3D%3D"></' + 'script>');
document.write('<script type=",

It cuts the end, but it seems it is actually connecting to the list, I also got a 200 http code in the list.

Now for the function Status I got: ParseError.

And for the totalRows I got: NaN.

I feel like the parseError is where the problem is, but I can't figure out what I did wrong.

ps: I changed some of the urls for security reasons, but they're working just fine.

  • 1
    webURL is the URL of the SharePoint web (minus the/lists part). Try it with value as http://myWebSiteSharepoint.com.br/risk/dtm/gd. Just a note: try avoiding async:false wherever possible since it blocks the UI thread and leads to poor performance.
    – Akhoy
    Aug 24, 2018 at 14:09
  • @Akhoy Thank you for the answer, indeed the change made it better since now I get a responseXML in the javascript object. But i'm getting the myWebSiteSharepoint.com.br/risk/dtm/gd/_vti_bin/Lists.asmx HTTP POST 500 text/xml in my list, it says internal server error. Maybe it means I cant access it from a web page? Aug 24, 2018 at 14:27
  • Now i'm getting the "one or more fields are not installed correctly" despite i'm using internal field names from the url Aug 24, 2018 at 17:47
  • Something is wrong with your CAML query then. Try executing it in a CAML query builder and see if it returns results. u2u.be/software
    – Akhoy
    Aug 25, 2018 at 5:18

1 Answer 1


Since there is only 1 condition no need for <And> in CAML query. Update caml query like below,

 var query = '<Query>'+
                            '<FieldRef Name="Ambiente"/><Value Type="Text">SAS</Value>'+

Update your CAMLViewFields ,

var view = '<ViewFields>'+
                    '<FieldRef Name="Title" />'+
                    '<FieldRef Name="TrainingTitle" />'+
                    '<FieldRef Name="RequestStatus" />'+
                    '<FieldRef Name="Created" />'+
                    '<FieldRef Name="RequestorName" />'+
                    '<FieldRef Name="DeployementDate" />'+

And also update the DeployementDate retrieval like below,

Deployement = $(this).attr("ows_DeployementDate");

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.