Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: SPXmlToJson with variable

$
0
0
scottptsn:

I banged together this simple example. I think it should give you enough to go on.
    $().SPServices({
        operation: "GetListItems",
        async: false,
        listName: "Announcements",
        CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
        completefunc: function (xData, Status) {
            var mappings = {};
            mappings.ows_ID = {mappedName: "ID", objectType: "Counter"};
            var colName = "ows_Title";
            mappings[colName] = {mappedName: 'Title', objectType: 'Text'};
            
            var Json = $(xData.responseXML).SPFilterNode("z:row").SPXmlToJson({ 
                mapping: mappings,
                removeOws: true 
            });
            alert(done);
        }
    });
M.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



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