I'm building a SharePoint SPFx using react.

In one of my components I want to have a comment section. Where a user can write a comment and then submit it to my Multiple lines of text field called comments. I currently have Append Changes to Existing Text set to `Yes.

Below I have a textarea to allow users to type a comment and then on submit I'm sending that comment to the comment field. However when someone submits another comment will this erase previous comments?

//Area to add comment

<button onClick={this.submitComment.bind(this)}>Submit</button>

//Function to submit comment 
submitComment(event) {
        Comments: this.state.Comments,              
    }).then(i => {

On another component I will make a call to display the comments and want it to look something similar to this:

<h4>Comments Below</h4>
   <p>First comment here</p>
   <p>07/12/2020 (get the date of submission I have a get_date function)</p>
   <p>Second comment here that was left</p>
   <p>Another comment here</p>

So I want that field to continue to hold all comments submitted and a way to loop through each one. For comments I don't see there being any long comments or more than 10 comments added.

I was using this for reference: https://sharepointmaven.com/how-to-track-comments-with-append-changes-functionality-in-sharepoint-list/

1 Answer 1


PnP open-source projects offer a sample web part "Advanced Comments Box" that provided comment feature.

With a little modification, you can configure this comment box for every section.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.