My JSON Code sometimes skips columns, due to the Source tables not being filled out completely. Null fields aren't returned in my web service.
SPservices only brings back the columns that are not null.
myJavascript:
Console Info:
What are my options?
Does the data have to be absolutely consistent each time?
I'm doing a webservices request for XML, tranforming to JSON and then posting to Datatables.
Can I turn off the debug... and just skip the Datatables Error message.
Or should I go back to my original webservice and see If I can change SPservices? What's the best practice or proper approach on this?
SPservices only brings back the columns that are not null.
myJavascript:
$().SPServices({ operation: "GetListItems", async: false, webUrl: "http://mywebsite.com", listName: listA, //EDIT HERE// This is the Name of the Sharepoint List you want to Retrieve completefunc: function (xData, Status) { myJson = $(xData.responseXML).SPFilterNode("z:row").SPXmlToJson({ mapping: { ows_LinkFilename: { mappedName: "Filename", objectType: "Text" }, ows_Title: { mappedName: "Title", objectType: "Text" }, ows_Unit_x0020_NO: { mappedName: "UnitNo", objectType: "Lookup" }, ows_Area: { mappedName: "Area", objectType: "Lookup" }, ows_Complex: { mappedName: "Complex", objectType: "Lookup" }, ows_DocType: { mappedName: "DocType", objectType: "Lookup" } }, // name, mappedName, objectType includeAllAttrs: false }); //alert(myJson[0]["Title"]);//returns the value return myJson }// End of completefunc }); //End of SPServices
Console Info:
Row1 Debug: Object {Filename: "Test Folder", Title: "Test Folder"}
Row2 Debug: Object {Filename: "007316.pdf", Title: "7V-316", UnitNo: Object, Area: Object, Complex: Object…}
What are my options?
Does the data have to be absolutely consistent each time?
I'm doing a webservices request for XML, tranforming to JSON and then posting to Datatables.
Can I turn off the debug... and just skip the Datatables Error message.
Or should I go back to my original webservice and see If I can change SPservices? What's the best practice or proper approach on this?