Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get SP.List property using SharePoint JSOM
function getListProperties(listTitle, OnSuccess,OnError) {
var context = SP.ClientContext.get_current();
var web = context.get_web();
var list = web.get_lists().getByTitle(listTitle);
var schemaXml = list.get_schemaXml();
var listJson = schemaXml2Json(schemaXml);
function schemaXml2Json(schemaXml)
var jsonObject = {};
var schemaXmlDoc = $.parseXML(schemaXml);
$(schemaXmlDoc).find('List').each(function() {
$.each(this.attributes, function(i, attr){
jsonObject[] = attr.value;
return jsonObject;
Copy link

DeepMalh44 commented Jun 2, 2015

Do u know how to make this work for Spanish sites where the PAGES library is PAGINAS? this script fails there ...any way to get it working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment