Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

google sheets - How to get a note or comment

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...