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

New Post: SPXmlToJson with variable

$
0
0
I am attempting to use SPXmlToJson in conjunction with a GetListItems which worked great however; I am in need of allowing my function to dynamically pull from different lists based on a user input. Using global variables I am able to change mappedName and objectType. I am unable to use a variable for the name (ows_x) it doesn’t read the value but attempts to pull the variable name as the value. Any help would be appreciated I am relatively new to this so if it’s a simply error please forgive me.

var Json = $(xData.responseXML).SPFilterNode("z:row").SPXmlToJson({
mapping: {
 ows_ID: {mappedName: varX, objectType: varY}, //this works
 varA: {mappedName: varB, objectType: varC} //this does not
},   
includeAllAttrs: true
removeOws: true
});

Viewing all articles
Browse latest Browse all 6517

Trending Articles



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