Time stamp update

What your working on is a copy of the sheet i really use. Go ahead and mess up whatever you want. lol

Okay, done. Here’s the modified function:

function myFunction() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName('NoIP');
  var headers = sheet.getRange(1,1,1,sheet.getLastColumn()).getValues();
  var source_col_index = headers[0].indexOf('HTTP_up');
  var target_col_index = headers[0].indexOf('Monitoring Since');
  var data = sheet.getRange(2,1,sheet.getLastRow()-1,sheet.getLastColumn()).getValues();
  var now = new Date();
  data.forEach(function (row) {
    var source_col_val = row[source_col_index];
    if (source_col_val.match(/✅/) ) {
      row[target_col_index] = now;
    }
  });
  sheet.getRange(2,1,sheet.getLastRow()-1,sheet.getLastColumn()).setValues(data);
}
3 Likes

Working Great. I changed now to = whats in B3. Since the pi updates that cell. If the pi is offline then it cant see whats online. Thank you again.
Also added conditions for easy view. image