I found this StackOverflow answer that says "You can get the suggestions made in a document doing a get request," but when I follow the link I see Java and Python options. How can I actually get suggestions using exclusively Google Apps Script? I don't need to modify them at all, just get their existence.
Asked
Active
Viewed 384 times
1 Answers
0
Use Docs
service of Apps Script and access the data you need to have based on its response.
Script:
function myFunction() {
var documentId = <document ID>;
var doc = Docs.Documents.get(documentId);
doc.body.content.forEach(function (content){
if (content.paragraph) {
var elements = content.paragraph.elements;
elements.forEach(function (element){
if(element.textRun.suggestedDeletionIds)
Logger.log("suggested to delete: " + element.textRun.content)
if(element.textRun.suggestedInsertionIds)
Logger.log("suggested to insert: " + element.textRun.content)
});
}
});
}
Sample Data:
Output:
Reference:

NightEye
- 10,634
- 2
- 5
- 24
-
Error trying to save this code in editor: Syntax error: SyntaxError: Unexpected token '<' line: 2 file: ag1.gs – Cooper Jun 09 '21 at 23:42
-
@Cooper, replace `
` with the actual document id of the doc file. – NightEye Jun 09 '21 at 23:57