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?

  • 1
    You will want to use the SocialData services, particularly the GetTagsOfUser to see what the user has liked – Eric Alexander Oct 8 '14 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. Oct 8 '14 at 18:20

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

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

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.