I have a section of my code where I am retrieving a list item using SPServices GetListItems.
When pulling back the data for use I a missing one of my fields which I need for the display to work properly. The field is in the default view and I can see the field in the response text of the promise but cannot find it in the responseXML. The field itself is a Multiple Line of Text Plain Text field.
Here is the section of code that is failing
var spPromise = $().SPServices({
webURL : "/sites/rc/cas/",
operation: "GetListItems",
CAMLViewFields: "<ViewFields Properties='True' />",
CAMLQuery: camlQuery ,
listName: "Assessment Process",
CAMLQueryOptions: "<QueryOptions><ExpandUserField>True</ExpandUserField></QueryOptions>",
});
spPromise.done(function() {
console.log(spPromise);
var procs = $(spPromise.responseXML).SPFilterNode("z:row").SPXmlToJson({
includeAllAttrs: true,
removeOws: true,
sparse: false });
});
I am returning the rest of the data
In spPromise.responseText the field is there ows_Process_x0020_Comment='TEST'
I can find the field when running the rest query
var thisUrl = "***Omitted***/sites/rc/cas";
thisUrl += "/_vti_bin/listdata.svc/"
thisUrl += "AssessmentProcess(" + id + ")"; $.ajax({
url: thisUrl,
method : "GET",
headers: {"Accept" : "application/json; odata=verbose" },
success: function (data) {
console.log(data);
},
error: function (data) {
console.log(data);
}
});
but don't really want to be rewriting the rest of my code to handle this
I have also tried looking for the attribute directly in the xml and returning all of the attributes in z:row but with no luck.
$(spPromise.responseXML).SPFilterNode("z:row").each(function() {
$.each(this.attributes, function(i, attr) {
var name = attr.name;
var value = attr.value;
console.log("Name: " + name + " : Value: " + value);
});
proc.Process_x0020_Comment = $(this).attr('ows_Process_x0020_Comment');
});
I guess I could pull this data out of the responseText but would prefer to get this working without having to resort to anything like that.
Has anyone seen anything like this before or have any ideas on what might be going wrong as this has stumped me for about half a day now.