1

I'm using getlistitems to grab list data in SharePoint 2013, and I've managed to be able to filter by the current user's "liked" list items... but is there a way to sort by what a user has liked and show those items first?

CAMLQuery for filtering by current users likes:

<Where><Eq><FieldRef Name='LikedBy' /><Value Type='Integer'><UserID /></Value></Eq></Where>

Additionally is it possible to use updatelistitems to "like" an item?

2
  • 1
    You will want to use the SocialData services, particularly the GetTagsOfUser to see what the user has liked Commented Oct 8, 2014 at 17:34
  • Any insight on how to do this? I haven't been able to find many examples of the SocialDataServices and everything I try returns undefined. Hmm.
    – Richard S.
    Commented Oct 8, 2014 at 18:20

1 Answer 1

0

You would do something like this (untested and going from memory):

$().SPServices({
  operation: "GetTagsofUser",
  userAccountName: $().SPServices.SPGetCurrentUser({fieldName: "Name", debug: false}),
  completefunc: function (xData, Status) {
    console.log(xData.responseText);
  }
});
1
  • correction - its GetTagsOfUser and this method is depracated Commented Feb 13, 2019 at 10:01

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.