3

Is there any way that I can see who liked a sharepoint item outside of the "hover the smiley face" and a popup shows the users who liked it?

Ideally, I would like to export every single user who has liked an item within the entire list to something like excel, where I can analyze it.

0

I know its too late but it might help others:

<script>
    $(document).ready(function() {
      $(".ms-comm-likesMetadata").mouseover(function() {
        var endpoint = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('List name')/Items("+ parseInt(this.nextElementSibling.id.split('-')[1])+")?$select=LikedBy/Title&$expand=LikedBy"
        $.when($.ajax({
           url: endpoint,
           async:false,
           method: "GET",  
           headers: { "Accept": "application/json; odata=verbose" },
           success: function (data) {           
           if(data.d.LikedBy.results.length > 0)
           {
              for(var pp=0;pp<data.d.LikedBy.results.length;pp++)
              {              
               alert(data.d.LikedBy.results[pp].Title);
              }
           }
           }, error: function (err)  {

           }
      })).done(function(data) {              
      });   
   });
});
</script>
0

You can create a SP Designer workflow to do this. Research some examples of using the Call HTTP web service action in SP Designer for more specifics, but here is a summary:

Call HTTP Web Service (HTTP Get) to your list, example HTTP web service URL: yoursite/_api/web/lists/GetByTitle('Posts')/Items?$select=LikesCount,LikedBy/Title&$expand=LikedBy&$filter=Title eq ('Title*')

Title*= set equal to current item title

Then Get Item from Dictionary: Get (0)/LikedBy/results output to another dictionary variable (LikedByDic).

Count items in above step and then create Loop to run through the second dictionary.

Within the Loop, Get (CountVariableUsedInLoop)/Title from the second dictionary (LikedByDic) output to string variable(UserLikedBy)(this will be the user who liked the post).

I created another string variable (AllUsers) within the loop to add each user: Set Variable: AllUsers to [%Variable:UserLikedBy%];[%Variable:AllUsers%]

Then a final step after the loop stage to email me the value of this string variable (AllUsers).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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