4

So I want a way to record notes from Google Home with a timestamp. Unfortunately Google Home doesn't provide this so I found a workaround using IFTTT Applet here:

https://ifttt.com/applets/DMC8yDAW-log-notes-in-a-google-drive-spreadsheet

This gets me 80% of the way, the missing part is inserting timestamp of when the note was taken. I found some code that does this and works if I manually edit the sheet:

function onEdit() {
  var s = SpreadsheetApp.getActiveSheet();
  if( s.getName() == "Sheet1" ) { //checks that we're on the correct sheet
    var r = s.getActiveCell();
    if( r.getColumn() == 4 ) { //checks the column
      var nextCell = r.offset(0, 1);
      if( nextCell.getValue() === '' ) //is empty?
        nextCell.setValue(new Date());
    }
  }
}

This however doesn't work with the IFTTT Applet! Any idea how I can do this?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
JKL
  • 99
  • 1
  • 1
  • 5
  • You will have to install an on [change trigger](https://developers.google.com/apps-script/guides/triggers/installable#managing_triggers_manually). Also on change trigger will not give you any way to monitor which cell or row was modified. So you will have to manage that. – Jack Brown Apr 20 '17 at 21:12
  • @JKL did you find a solution to this problem? I am looking for the same thing. – chesterm8 Aug 28 '17 at 05:36
  • 1
    Yes. My use case is here https://medium.com/@ravlondon/big-data-for-babies-using-google-home-to-log-the-activity-of-a-newborn-f6fb586907b7 scroll right to bottom for timestamp fix. – JKL Aug 28 '17 at 18:58

0 Answers0