Reputation: 409
How Can I add comment to google sheet using app script. I can add notes but i want to add comments. tried different methods but no clue.
.setcomments
and
.getcomments
function not even exisit.
Upvotes: 0
Views: 214
Reputation: 15318
I achive to add a comment with :
function insertDriveComment(){
var fileId = 'your file id'
var resource = {'content': 'Here is my comment !'};
Drive.Comments.insert(resource, fileId)
}
you have to enable Drive API service
or, if you use the same spreadsheet to add comments
function insertDriveComment(){
var fileId = SpreadsheetApp.getActiveSpreadsheet().getId()
var resource = {'content': 'Here is my comment !'};
Drive.Comments.insert(resource, fileId)
}
Upvotes: 2