-6

Regarding Google Appscripts. If creating apps with Appscrips for Google Docs, Google Presentation, and other Drive applications, is it possible to program such apps to create, read and write to Google Spreadsheets on the same Google account?

If possible, I would appreciate a link to a description of the method.

Thanks

PeterM
  • 1
  • I read the site you link to above, but can find no info if it's possible to communicate between a Google Docs or Presentation App and a Spreadsheet. That is why I asked here. – PeterM Mar 20 '18 at 07:40

1 Answers1

0

This function will read row 12 and column1 of a spreadsheet Sheet1 and append it to the document that contains it. It also changes the value of row 13 column1 of Sheet1;

function getRow12Column1(){
  var doc=DocumentApp.getActiveDocument();
  var body=doc.getBody();
  var ss=SpreadsheetApp.openById('id');
  var sh=ss.getSheetByName('Sheet1');
  var rg=sh.getDataRange();
  var vA=rg.getValues();
  body.appendParagraph(vA[11][0]);
  vA[12][0]+=1;
  rg.setValues(vA);
}
Cooper
  • 59,616
  • 6
  • 23
  • 54