Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: Pass variable into SPXmlToJson function

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;

                $().SPServices({
                    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
            };

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>