I am trying to copy a Google Sheet while retaining all the comments (which are associated with cells), following this.
Everything works fine until the line Drive.Comments.insert(item, documentId).commentId
An error saying:
Anchor is missing required property root.r`
appeared.
Has anyone tried doing so, and could you enlighten me on what's wrong?
My attempt
I tried to look deeper into the Google Drive APIs, the example they gave is only for "document-level comment", and allows no where for the anchor to be input.
The second answer here claims that it is impossible to attach programmatically the comment to a cell, because the anchors for Spreadsheet Comments are proprietary. This seems to contradict with the first link (unless the first link only talks about document wide comments)
Seems like setting comments in Google Sheet have been requested for a long time, yet it hasn't been implemented. (here and here) So using the Drive API seems to be the only way to insert comment.
Any help is highly appreciated!