SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Am I missing something? It looks like I can't follow a document set in a document library. I can indeed follow any document inside the document set, but not the set itself. Is there a way to enable this?

share|improve this question

It does not seem possible to follow Document Set since Social Actor supports only the following types:

  • User A user
  • Document A document.
  • Site A site.
  • Tag A tag

But you could consider the following approach. The idea is to follow Document Set content (files). The solution consists of:

  • getting Document Set files
  • follow files in document set

JavaScript example

function startFollowing(webUrl,fileUrl){
    var endpointUrl = webUrl + "/_api/social.following/follow";
    var actor = {
             "ContentUri": fileUrl,
    return executeRequest(endpointUrl,'POST',null,actor);

function getFiles(webUrl,folderUrl){
    var endpointUrl = webUrl + "/_api/web/GetFolderByServerRelativeUrl('" + folderUrl + "')/files";         
    return executeRequest(endpointUrl,'GET');

function followFiles(webUrl,folderUrl)
    return getFiles(webUrl,folderUrl).then(function(data){
        var files = data.d.results;
        if(files.length == 0) return;
        var fileUrl = webUrl + '/' + folderUrl + '/' + files[0].Name; //server absolute file url
        data = startFollowing(webUrl,fileUrl);
        for (var i = 1; i < files.length; i++) {
          (function (i) {
             data = data.then(function() {
                 fileUrl = webUrl + '/' + folderUrl + '/' + files[i].Name;
                 return startFollowing(webUrl,fileUrl);


function executeRequest(url,method,headers,payload) 
    if (typeof headers == 'undefined' || headers == null){
        headers = {};
    headers["Accept"] = "application/json;odata=verbose";
    if(method == "POST") {
        headers["X-RequestDigest"] = $("#__REQUESTDIGEST").val();

    var ajaxOptions = 
       url: url,   
       type: method,  
       contentType: "application/json;odata=verbose",
       headers: headers
    if(method == "POST") { = JSON.stringify(payload);

    return $.ajax(ajaxOptions);


Assume a Documents library contains Guides document set, then the following example demonstrates how to follow files in document set:

var webUrl = _spPageContextInfo.webAbsoluteUrl;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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