SPScriptlet 3 - Using Taxonomy

SP.Taxonomy.JS is fairly undocumented on MSDN, but it offers you interaction with the entire managed metadata system from SharePoint 2013. Before you dig into these code samples, you’ve to ensure that your App requests proper permissions in order to deal with SharePoint’s managed metadata service. Using Napa, this is fairly easy. Just fire up the property window and set the App permissions as shown in figure 1

In order to keep the JS scripts clean and readable, I’ve created an App class, which is responsible for App lifecycle management, the entire Taxonomy automation goes into the TaxonomyService class.  

The TaxonomyService class is responsible for dealing with SharePoint’s JSOM API. Although the API is undocumented, you can dig through the debug.js version in order to find the methods and properties you’re looking for. The current state of my TaxonomyService is able to

  • List Terms
  • Create Terms
  • Create Term Sets

If you’re interested in an working example, just browse the entire code on github at (https://github.com/ThorstenHans/SPTaxonomySample)

Comments

comments powered by Disqus