Version

Taxonomy.getTermsByLabel

This method is used to retrieve managed metadata from a SharePoint site. You can get all the existing terms containing a specific text.

Syntax

SPlus.Taxonomy.geTermsByLabel (url, label, function (terms){
        for (var i=0; i < terms.length; i++) {//Loop the terms Array
            var term = terms [i];//Getting one of the requested terms
            //TODO: Implement what to do with the terms
        }
}, function (errorResponse){
        var error = errorResponse['error#displayValue']; //Getting the error
        //TODO: Implement how to handle errors
}, function (cancelResponse){
        //TODO: Implement how to handle a user’s cancel
});

Taxonomy.getTermsByLabel Parameters

Parameter

Type

Description

url

String

URL to the SharePoint site.

label

String

Text (letters or words) to be searched in the existing terms.

onSuccess callback function

Parameter

Description

function (terms)

Success callback function to be implemented, which receives an Array with the terms.

onError callback function

Parameter

Description

function (eResponse)

Error callback function to be implemented, which receives the eResponse JavaScript Object.

onCancel callback function

Parameter

Description

function (result)

Cancel callback function to be implemented.