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?