-1

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.

Spencer
  • 453
  • 4
  • 21

1 Answers1

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:

sample

Output:

output

Reference:

NightEye
  • 10,634
  • 2
  • 5
  • 24