var myTerm = getTermInfo('term name');

specially i need to get the GUID of the term, i know that after getting guid i can get all the other properties of that particular term.

1 Answer 1


You can get the store (by name) then the SP.Taxonomy.TermCollection and then the term by name.

Based on: Working with Taxonomy and JavaScript in SharePoint 2013


    var scriptbase = _spPageContextInfo.webServerRelativeUrl + "_layouts/15/";

    $.getScript(scriptbase + "SP.Runtime.js",
        function () {
            $.getScript(scriptbase + "SP.js", function(){

                $.getScript(scriptbase + "SP.Taxonomy.js", execOperation);



function execOperation(){

    //Current Context
    var context = SP.ClientContext.get_current();

    //Current Taxonomy Session
    var taxSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(context);

    //Term Stores
    var termStores = taxSession.get_termStores();

    //Name of the Term Store from which to get the Terms.
    var termStore = termStores.getByName("Taxonomy_name");

    //GUID of Term Set from which to get the Terms.
    var termSet = termStore.getTerms();

    var terms = termSet.getAllTerms().getByName("term name");



    var termEnumerator = terms.getEnumerator();

    var termList = "Terms: \n";


            var currentTerm = termEnumerator.get_current();

            termList += currentTerm.get_name() + "\n";







Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.