Manage cell comments in Spreadsheet Editor
Spreadsheet Editor lets users add comments and threaded replies to specific spreadsheet cells. You can then collaborate with comments by asking questions, flagging issues, and replying right where the work is happening. This is useful when reviewing reports, checking calculations, or working on a forecast across teams.
Legacy notes are supported but are converted to the comment threads upon load. Saving will not retain legacy notes since they have already been converted.

Manage comments via API
This section covers the APIs for working with cell comments and replies. You create, change, and delete comments through the CommentManager class. Each comment is returned as a read-only SpreadsheetComment object.
Get the comment manager
Use the SpreadsheetEditorManager.getCommentManager API to get the comment manager. The CommentManager class contains all APIs needed to get, create, edit, resolve, and delete comments and replies. The following code sample gets the comment manager once the editor is ready.
Get comments
Use the CommentManager.getComments API to retrieve all comments in a workbook. Each comment is a read-only SpreadsheetComment object that contains the comment's message, cell address, state, author, and replies. The following code sample counts the comments in the workbook and logs the details of the first one.
Add comments or replies
Use the CommentManager.addComment or CommentManager.addReply APIs to create a new comment or reply, respectively.
Edit comments or replies
Use the CommentManager.setCommentMessage API to update a comment or reply message.
Resolve comments
Use the CommentManager.setCommentState API to resolve or re-open comment threads. Available options are under the SpreadsheetCommentState enum.
Adding replies or editing a resolved comment will automatically change the state back to OPEN.
Delete comments or replies
Use the CommentManager.deleteComment API to delete a comment or reply. Deleting a comment will also delete its replies. Deleting a reply will not delete its parent comment or sibling replies. The following code sample deletes the first comment in the workbook.
Last updated
Was this helpful?