Enable Likes in modern page comments

%3CLINGO-SUB%20id%3D%22lingo-sub-130802%22%20slang%3D%22en-US%22%3EEnable%20Likes%20in%20modern%20page%20comments%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-130802%22%20slang%3D%22en-US%22%3E%3CP%3EI%C2%B4m%20working%20on%20an%20SPFx%20web%20part%20to%20show%20aggregated%20comments%26nbsp%3Bmade%20within%20a%20site.%20I%20am%20able%20to%20get%20all%20info%20about%20a%20comment%20through%20REST%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3Ehttps%3A%2F%2Fxxx.sharepoint.com%2Fsites%2Fvmf-lab%2F_api%2Fweb%2Flists('%24%7Bthis.properties.pagelibraryid%7D')%2FGetItemById(%24%7Bpage.Id%7D)%2Fcomments%3F%24select%3DcreatedDate%2Ctext%2Creplycount%2ClikeCount%2Cauthor%2Fname%26amp%3B%24expand%3Dauthor%3C%2FPRE%3E%0A%3CP%3EI%20want%20to%20display%20the%20likeCount%20for%20a%20comment%2C%20but%20it%20does%20not%20seem%20to%20be%20possible%20to%20like%20a%20comment%20on%26nbsp%3Ba%20modern%20page%2C%20only%20reply%20to%20it...%20Or%20am%20I%20missing%20something..%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-130853%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20Likes%20in%20modern%20page%20comments%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-130853%22%20slang%3D%22en-US%22%3E%3CP%3Eindeed%2C%20I%20found%20the%20same%20when%20I%20tried%20the%20REST%20call.%20The%20likeCount%20is%20always%20set%20to%200%20and%20the%20interface%20doesn't%20have%20an%20option%20to%20change%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20wonder%20if%20it%20is%20possible%20to%20update%20the%20likeCount%20through%20the%20API.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-130847%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20Likes%20in%20modern%20page%20comments%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-130847%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F2387%22%20target%3D%22_blank%22%3E%40Pieter%20Veenstra%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20just%20pasted%20the%20REST-call%20above%20in%20Postman%20to%20get%20all%20comment%20properties.%20Works%20fine.%20Just%20surprising%20that%20there%20is%20a%20property%20named%20likeCount%2C%20when%20it%20isn%C2%B4t%20possible%20to%20like%20a%20comment%20%3A)%3C%2Fimg%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%26lt%3B%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%26gt%3B%0A%26lt%3Bfeed%20xml%3Abase%3D%22https%3A%2F%2Fxxx.sharepoint.com%2Fsites%2Flab%2F_api%2F%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2005%2FAtom%22%20xmlns%3Ad%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fado%2F2007%2F08%2Fdataservices%22%20xmlns%3Am%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fado%2F2007%2F08%2Fdataservices%2Fmetadata%22%20xmlns%3Ageorss%3D%22http%3A%2F%2Fwww.georss.org%2Fgeorss%22%20xmlns%3Agml%3D%22http%3A%2F%2Fwww.opengis.net%2Fgml%22%26gt%3B%0A%20%20%20%20%26lt%3Bid%26gt%3B8bef73cd-dfcc-40e4-938a-2f1b763b6ff8%26lt%3B%2Fid%26gt%3B%0A%20%20%20%20%26lt%3Btitle%20%2F%26gt%3B%0A%20%20%20%20%26lt%3Bupdated%26gt%3B2017-11-23T13%3A22%3A58Z%26lt%3B%2Fupdated%26gt%3B%0A%20%20%20%20%26lt%3Bentry%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3Bid%26gt%3Bhttps%3A%2F%2Fxxx.sharepoint.com%2Fsites%2Flab%2F_api%2Fweb%2Flists('6c0a16c3-c8d8-47ce-81f5-ba7893d00d0c')%2FGetItemById(33)%2FComments(2)%26lt%3B%2Fid%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3Bcategory%20term%3D%22Microsoft.SharePoint.Comments.comment%22%20scheme%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fado%2F2007%2F08%2Fdataservices%2Fscheme%22%20%2F%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3Blink%20rel%3D%22edit%22%20href%3D%22https%3A%2F%2Fxxx.sharepoint.com%2Fsites%2Flab%2F_api%2Fweb%2Flists('6c0a16c3-c8d8-47ce-81f5-ba7893d00d0c')%2FGetItemById(33)%2FComments(2)%22%20%2F%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3Btitle%20%2F%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3Bupdated%26gt%3B2017-11-23T13%3A22%3A58Z%26lt%3B%2Fupdated%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3Bauthor%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bname%20%2F%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3B%2Fauthor%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3Bcontent%20type%3D%22application%2Fxml%22%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bm%3Aproperties%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3Aauthor%20m%3Atype%3D%22SP.Sharing.Principal%22%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3Aemail%26gt%3BMaggan.Wahlin%40teknikhuset.se%26lt%3B%2Fd%3Aemail%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3Aid%20m%3Atype%3D%22Edm.Int32%22%26gt%3B68%26lt%3B%2Fd%3Aid%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3AisActive%20m%3Atype%3D%22Edm.Boolean%22%26gt%3Btrue%26lt%3B%2Fd%3AisActive%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3AisExternal%20m%3Atype%3D%22Edm.Boolean%22%26gt%3Bfalse%26lt%3B%2Fd%3AisExternal%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3AjobTitle%20m%3Anull%3D%22true%22%20%2F%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3AloginName%26gt%3Bi%3A0%23.f%7Cmembership%7Cmawah%40teknikhuset.se%26lt%3B%2Fd%3AloginName%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3Aname%26gt%3BMaggan%20W%C3%A5hlin%26lt%3B%2Fd%3Aname%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3AprincipalType%20m%3Atype%3D%22Edm.Int32%22%26gt%3B1%26lt%3B%2Fd%3AprincipalType%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3AuserId%20m%3Anull%3D%22true%22%20%2F%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3B%2Fd%3Aauthor%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3AcreatedDate%20m%3Atype%3D%22Edm.DateTime%22%26gt%3B2017-11-22T09%3A02%3A48Z%26lt%3B%2Fd%3AcreatedDate%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3AlikeCount%20m%3Atype%3D%22Edm.Int32%22%26gt%3B0%26lt%3B%2Fd%3AlikeCount%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3AreplyCount%20m%3Atype%3D%22Edm.Int32%22%26gt%3B1%26lt%3B%2Fd%3AreplyCount%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3Bd%3Atext%26gt%3BTrying%20out%20the%20comment-function%26lt%3B%2Fd%3Atext%26gt%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%26lt%3B%2Fm%3Aproperties%26gt%3B%0A%20%20%20%20%20%20%20%20%26lt%3B%2Fcontent%26gt%3B%0A%20%20%20%20%26lt%3B%2Fentry%26gt%3B%0A%26lt%3B%2Ffeed%26gt%3B%3C%2FPRE%3E%0A%3CP%3EWell%2C%20I%20guess%26nbsp%3B%3CSTRONG%3Egood%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ethings%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ehappen%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Eto%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ethose%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ewho%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3Ewait%20%3A)%3C%2Fimg%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-130840%22%20slang%3D%22en-US%22%3ERe%3A%20Enable%20Likes%20in%20modern%20page%20comments%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-130840%22%20slang%3D%22en-US%22%3E%3CP%3EHI%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F55998%22%20target%3D%22_blank%22%3E%40Maggan%20W%C3%A5hlin%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20think%20that%20liking%20comments%20might%20be%20something%20that%20is%20on%20its%20way.%20If%20you%20open%20the%20site%20with%20SharePoint%20Designer%20then%20you%20will%20see%20that%20there%20is%20a%20hidden%20list%20with%20a%20name%20like%3A%20Comments%3CGUID%3E%3C%2FGUID%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWithin%20this%20list%20there%20is%20a%20set%20of%20fields%20related%20to%20likes.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20answer%20you%20question%2C%20I%20don't%20think%20that%20you%20can%20like%20any%20comments%20at%20the%20moment.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Contributor

I´m working on an SPFx web part to show aggregated comments made within a site. I am able to get all info about a comment through REST:

 

https://xxx.sharepoint.com/sites/vmf-lab/_api/web/lists('${this.properties.pagelibraryid}')/GetItemById(${page.Id})/comments?$select=createdDate,text,replycount,likeCount,author/name&$expand=author

I want to display the likeCount for a comment, but it does not seem to be possible to like a comment on a modern page, only reply to it... Or am I missing something..?

 

 

3 Replies
Highlighted

HI @Maggan Wåhlin,

 

I think that liking comments might be something that is on its way. If you open the site with SharePoint Designer then you will see that there is a hidden list with a name like: Comments<GUID>

 

Within this list there is a set of fields related to likes. 

 

To answer you question, I don't think that you can like any comments at the moment.

Highlighted

Thank you @Pieter Veenstra.

 

I just pasted the REST-call above in Postman to get all comment properties. Works fine. Just surprising that there is a property named likeCount, when it isn´t possible to like a comment :)

 

<?xml version="1.0" encoding="utf-8"?>
<feed xml:base="https://xxx.sharepoint.com/sites/lab/_api/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
    <id>8bef73cd-dfcc-40e4-938a-2f1b763b6ff8</id>
    <title />
    <updated>2017-11-23T13:22:58Z</updated>
    <entry>
        <id>https://xxx.sharepoint.com/sites/lab/_api/web/lists('6c0a16c3-c8d8-47ce-81f5-ba7893d00d0c')/GetItemById(33)/Comments(2)</id>
        <category term="Microsoft.SharePoint.Comments.comment" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
        <link rel="edit" href="https://xxx.sharepoint.com/sites/lab/_api/web/lists('6c0a16c3-c8d8-47ce-81f5-ba7893d00d0c')/GetItemById(33)/Comments(2)" />
        <title />
        <updated>2017-11-23T13:22:58Z</updated>
        <author>
            <name />
        </author>
        <content type="application/xml">
            <m:properties>
                <d:author m:type="SP.Sharing.Principal">
                    <d:email>Maggan.Wahlin@teknikhuset.se</d:email>
                    <d:id m:type="Edm.Int32">68</d:id>
                    <d:isActive m:type="Edm.Boolean">true</d:isActive>
                    <d:isExternal m:type="Edm.Boolean">false</d:isExternal>
                    <d:jobTitle m:null="true" />
                    <d:loginName>i:0#.f|membership|mawah@teknikhuset.se</d:loginName>
                    <d:name>Maggan Wåhlin</d:name>
                    <d:principalType m:type="Edm.Int32">1</d:principalType>
                    <d:userId m:null="true" />
                </d:author>
                <d:createdDate m:type="Edm.DateTime">2017-11-22T09:02:48Z</d:createdDate>
                <d:likeCount m:type="Edm.Int32">0</d:likeCount>
                <d:replyCount m:type="Edm.Int32">1</d:replyCount>
                <d:text>Trying out the comment-function</d:text>
            </m:properties>
        </content>
    </entry>
</feed>

Well, I guess good things happen to those who wait :)

 

 

 

Highlighted

indeed, I found the same when I tried the REST call. The likeCount is always set to 0 and the interface doesn't have an option to change it.

 

I wonder if it is possible to update the likeCount through the API.