SP へUserProfiles.PeopleManager.getTrendingTags 方法 (sp.userprofiles)

最も一般的なノート シールを取得します。getTrendingTagsは、静的な方法です。

**適用対象:**apps for SharePoint | Office 365 | SharePoint Foundation 2013 | SharePoint Server 2013

SP.UserProfiles.PeopleManager.getTrendingTags(context)

パラメーター

戻り値

SP.UserProfiles.HashTagCollection
、20 最も人気のあるハッシュ タグ過去 1 週間、よく使われるタグが最初に表示されるように並べ替えられます。

次の例では、現在のコンテキストで、フォローするタグを取得します。

var trendingTags;

// Ensure that the SP.UserProfiles.js file is loaded before the custom code runs.
SP.SOD.executeOrDelayUntilScriptLoaded(getTrendingTags, 'SP.UserProfiles.js');

function getTrendingTags() {

    // Get the current client context and call the getTrendingTags static method.
    var clientContext = new SP.ClientContext.get_current();
    trendingTags = new SP.UserProfiles.PeopleManager.getTrendingTags(clientContext);

    // Load the query and send the request.
    clientContext.load(trendingTags);
    clientContext.executeQueryAsync(onRequestSuccess, onRequestFail);
}

// This function runs if the executeQueryAsync call succeeds.
function onRequestSuccess() {

    // Get trending tag information.
    alert('There are ' + trendingTags.get_count() + ' trending tags.');
    alert('The name of the first tag is ' + trendingTags.itemAt(0).get_name());
    alert('The use count of the first tag is ' + trendingTags.get_item(0).get_useCount());
}

// This function runs if the executeQueryAsync call fails.
function onRequestFail(sender, args) {
    alert('Error: ' + args.get_message());
}

関連項目

その他の技術情報

PeopleManager