How to get a note or comment

Kokizzu picture Kokizzu · Sep 2, 2015 · Viewed 8k times · Source

I have an Excel containing cell comments/notes, I've uploaded it to Google Drive, and converted it into a Google Spreadsheet. How may I retrieve the comments for cell A1?

The API doesn't describe how to get a note or comment from a cell.

Answer

Mogsdad picture Mogsdad · Sep 7, 2015

The Google Apps Spreadsheet API only provides programmatic access to spreadsheet data. You cannot access comments using the API.

You can get the Notes for a cell or range of cells using Google Apps Script. See the Class Range documentation for these methods:

  • getNote() - Returns the note associated with the given cell.
  • getNotes() - Returns the notes associated with the cells in the range.

There are open issues related to this functionality, mainly concerning comments (the "other" type of note). See Issue 1818 and Issue 2566

In a comment on your question, SGC asks if you've looked at developers.google.com/drive/v2/reference/comments/get and developers.google.com/drive/v2/reference/comments/list; these are FILE level comments, not the comments attached to a spreadsheet cell.