Display Comments in Sharepoint list

%3CLINGO-SUB%20id%3D%22lingo-sub-1966968%22%20slang%3D%22en-US%22%3EDisplay%20Comments%20in%20Sharepoint%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1966968%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewe%20can%20now%20use%20the%20new%20sharepoint%20comment%20function%20to%20comment%20a%20list%20item.%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20possibilty%20to%20show%20the%20last%20comment%20in%20the%20table%20view%3F%20Or%20get%20this%20via%20JSON%20formatter%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20only%20have%20found%20a%20solution%20to%20get%20the%20number%20of%20comments%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fpnp%2Fsp-dev-list-formatting%2Ftree%2Fmaster%2Fcolumn-samples%2Fgeneric-comment-count%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fpnp%2Fsp-dev-list-formatting%2Ftree%2Fmaster%2Fcolumn-samples%2Fgeneric-comment-count%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhere%20are%20these%20comments%20stored%3F%20Is%20there%20a%20possibility%20to%20embed%20them%20on%20a%20sharepoint%20modern%20page%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1966968%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1967347%22%20slang%3D%22en-US%22%3ERe%3A%20Display%20Comments%20in%20Sharepoint%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1967347%22%20slang%3D%22en-US%22%3EThat's%20a%20very%20interesting%20question%20that%20I%20have%20already%20been%20asked%20for%2C%20but%20I'm%20not%20aware%20of%20a%20way%20to%20get%20list%20item%20comments.%20Per%20Ignite%20sessions%2C%20comments%20are%20stored%20within%20the%20list%20schema%20itself%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1995639%22%20slang%3D%22en-US%22%3ERe%3A%20Display%20Comments%20in%20Sharepoint%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1995639%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F478641%22%20target%3D%22_blank%22%3E%40chhe112%3C%2FA%3E%26nbsp%3BI%20had%20the%20same%20issue%20and%20watched%20network%20requests%20while%20adding%20a%20comment%20to%20a%20list%20item.%20There's%20a%20usuable%20API!%26nbsp%3BI%20reproduced%20like%20this%3A%3C%2FP%3E%3CP%20data-unlink%3D%22true%22%3Ehttps%3A%2F%2F%3CTENANT%3E.sharepoint.com%2F%3CSITE%3E%2F_api%2Fweb%2Flists(%40a1)%2FGetItemById(%40a2)%2FComments()%3F%40a1%3D'%3CLIST%3E'%26amp%3B%40a2%3D'%26amp%3B%2339%3B%26lt%3B%2FP%26gt%3B%26lt%3BP%20data-unlink%3D%22true%22%26gt%3B%26nbsp%3B%26lt%3B%2FP%26gt%3B%26lt%3BP%20data-unlink%3D%22true%22%26gt%3BNow%20I%20just%20need%20to%20figure%20out%20how%20to%20trigger%20a%20Flow%20when%20new%20comments%20are%20made%26nbsp%3B%26lt%3Bimg%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Flaugh_40x40.gif%22%20alt%3D%22%3Cimg%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Flaugh_40x40.gif%22%20alt%3D%22%3Alol%3A%22%20title%3D%22%3Alol%3A%22%20%2F%3E%22%20title%3D%22%3Cimg%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Flaugh_40x40.gif%22%20alt%3D%22%3Alol%3A%22%20title%3D%22%3Alol%3A%22%20%2F%3E%22%20%2F%26gt%3B%20Open%20to%20ideas!%26lt%3B%2FP%26gt%3B%26lt%3B%2Flingo-body%26gt%3B%26lt%3B%2Flingo-body%26gt%3B%3C%2FLIST%3E%3C%2FSITE%3E%3C%2FTENANT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello,

 

we can now use the new sharepoint comment function to comment a list item. 

Is there a possibilty to show the last comment in the table view? Or get this via JSON formatter?

 

I only have found a solution to get the number of comments:

https://github.com/pnp/sp-dev-list-formatting/tree/master/column-samples/generic-comment-count

 

Where are these comments stored? Is there a possibility to embed them on a sharepoint modern page?

 

4 Replies
That's a very interesting question that I have already been asked for, but I'm not aware of a way to get list item comments. Per Ignite sessions, comments are stored within the list schema itself

@chhe112 I had the same issue and watched network requests while adding a comment to a list item. There's a usuable API! I reproduced like this:

https://<tenant>.sharepoint.com/<site>/_api/web/lists(@a1)/GetItemById(@a2)/Comments()?@a1='<list guid>'&@a2='<comment ID>'

 

Now I just need to figure out how to trigger a Flow when new comments are made :lol: Open to ideas!

@Kevin_Flaherty 

 

I have found this API too. But I did not find a solution to trigger a flow if a new comment is added.

"If a item is modified" does not trigger by sending a new comment.

 

Are there any other solutions for this?

@chhe112 

 

Currently it is not possible to get the comments using JSON formatting. You can only get the count of comments added to list item using [$_CommentCount].

 

Comments are stored in list schema itself and not with list item. Check below blog for more information:

 

SharePoint Online: All you need to know about Commenting in Lists 


Please click Mark as Best Response if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.