I'm using Zapier to update a google sheet every time a new order gets placed, where a new row gets created.
For example
COL A | COL B
-------------
Sku No |
I'd like COL B to have the time stamp every time a row is created.
I have tried this script but it only works on edit that is, if the cell is manually edited.
function timestamp() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "Order Details" ) { //checks that we're on the correct sheet
var r = s.getActiveCell();
if( r.getColumn() == 4 ) { //checks the column
var nextCell = r.offset(0, -2);
if( nextCell.getValue() === '' ) //is empty?
nextCell.setValue(new Date());
}
}
}
I have seen come across examples that I now cannot refer back to, where a unique keyword used in a cell inserts a static timestamp when used with a script.
How can this be done? Any help is appreciated.