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%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%2F%400277EEB71C55CDE7DB26DB254BF2F52B%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%2F%400277EEB71C55CDE7DB26DB254BF2F52B%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%3CLINGO-SUB%20id%3D%22lingo-sub-1996676%22%20slang%3D%22en-US%22%3ERe%3A%20Display%20Comments%20in%20Sharepoint%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1996676%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F904446%22%20target%3D%22_blank%22%3E%40Kevin_Flaherty%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20found%20this%20API%20too.%20But%20I%20did%20not%20find%20a%20solution%20to%20trigger%20a%20flow%20if%20a%20new%20comment%20is%20added.%3C%2FP%3E%3CP%3E%22If%20a%20item%20is%20modified%22%20does%20not%20trigger%20by%20sending%20a%20new%20comment.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAre%20there%20any%20other%20solutions%20for%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2046176%22%20slang%3D%22en-US%22%3ERe%3A%20Display%20Comments%20in%20Sharepoint%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2046176%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%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECurrently%20it%20is%20not%20possible%20to%20get%20the%20comments%20using%20JSON%20formatting.%20You%20can%20only%20get%20the%20count%20of%20comments%20added%20to%20list%20item%20using%20%3CSTRONG%3E%5B%24_CommentCount%5D%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EComments%20are%20stored%20in%20list%20schema%20itself%20and%20not%20with%20list%20item.%20Check%20below%20blog%20for%20more%20information%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20title%3D%22SharePoint%20Online%3A%20All%20you%20need%20to%20know%20about%20Commenting%20in%20Lists%22%20href%3D%22https%3A%2F%2Fganeshsanapblogs.wordpress.com%2F2021%2F01%2F09%2Fall-you-need-to-know-about-commenting-in-lists%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ESharePoint%20Online%3A%20All%20you%20need%20to%20know%20about%20Commenting%20in%20Lists%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%20%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20to%20solve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3ELike%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%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?

 

6 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.

 

@ganeshsanap Hello! Thank you for the helpful information. I was also wondering if it is possible for comments to be included in a Power Automate flow? Currently I have flows built for list items to move from one list to another based on a Column selection ('Status') and would like for comments to also migrate when the list items moves to the other list based on the flow. Is this possible? 

 

@KWatsonLSOK 

 

List comments are not supported by default using SharePoint connector in Power Automate. You can manage that using SharePoint REST APIs.

 

Check "Working with SharePoint REST APIs" section in below blog for REST API endpoint to work with list comments:

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


Please click Mark as Best Response & Like 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.