This project has moved and is read-only. For the latest updates, please go here.

What Datatype is the Mapping Variable in SPServices?

Apr 15, 2013 at 9:29 PM
Edited Apr 15, 2013 at 9:30 PM
How would I pass in the mapping as a variable object?
Not to familiar with JSON/javascript arrary columns:
            function GetlistOps(myList, myList, myMap) {
                myJson = null;

                    operation: "GetListItems",
                    async: false,
                    webUrl: myUrl,
                    listName: myList
                    completefunc: function (xData, Status) {

                        myJson = $(xData.responseXML).SPFilterNode("z:row").SPXmlToJson({
                            mapping: {
                                ows_LinkFilename: { mappedName: "Filename", objectType: "Text" },
                            //instead pass in the myMap variable
                             }, // name, mappedName, objectType
                            includeAllAttrs: false
                        return myJson

                    }// End of completefunc
                }); //End of SPService
Apr 18, 2013 at 5:26 AM

If I understand your question, you can set a var to to mappings that you want. something like:
var myMap = {ows_LinkFilename: { mappedName: "Filename", objectType: "Text" };
Apr 18, 2013 at 5:28 AM
p.s. In JavaScript all vars are objects. JavaScript is not a strictly-typed language.