function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sijumv2sijumv2 

How to find the list of user who liked a feed element

Hello,
I want to find who all have liked an element in  the chatter feed. I am using Ver 30.
ConnectApi.ChatterLikePage.likes will this work? if not which method i should use.
Thank you
Best Answer chosen by sijumv2
sijumv2sijumv2
This worked for me. Thank you Gyanendra Singh
//GETTING LIKED LIST OF A FEED
            ConnectApi.ChatterLikePage likeList=f.likes;
            List<ConnectApi.ChatterLike> l=likeList.likes;
            for(ConnectApi.ChatterLike ll:l){
                       tempUser=new LikedUserDetail();
                     tempUser.userName=ll.user.name;
                    tempUser.userID=ll.user.id;
                    tempuser.userPhotoUrl=ConnectApi.ChatterUsers.getPhoto(commId,tempUser.userID).smallPhotoUrl;
                    urs.add(tempUser);
                system.debug(ll.user.id);
            }

All Answers

Yaswanth KothapalliYaswanth Kothapalli
Hi 

You can check this link for the same:

http://salesforce.stackexchange.com/questions/49965/chatter-likes-how-to-get-user-likes-per-record

Thanks,
Yaswanth K
sijumv2sijumv2
Thank you ,but version I am using is 30,in which that solution wont work.
sijumv2sijumv2
This worked for me. Thank you Gyanendra Singh
//GETTING LIKED LIST OF A FEED
            ConnectApi.ChatterLikePage likeList=f.likes;
            List<ConnectApi.ChatterLike> l=likeList.likes;
            for(ConnectApi.ChatterLike ll:l){
                       tempUser=new LikedUserDetail();
                     tempUser.userName=ll.user.name;
                    tempUser.userID=ll.user.id;
                    tempuser.userPhotoUrl=ConnectApi.ChatterUsers.getPhoto(commId,tempUser.userID).smallPhotoUrl;
                    urs.add(tempUser);
                system.debug(ll.user.id);
            }
This was selected as the best answer