# Time stamp update

**URL:** <https://community.glideapps.com/t/time-stamp-update/1382>\
**Category:** Ask for Help\
**Created:** [October 25, 2019, 3:55pm UTC](https://community.glideapps.com/t/time-stamp-update/1382 "2019-10-25T15:55:07Z")\
**Posts on this page:** 5\
**Page:** 5

<div class="post-metadata">

**Author:** ![abe.sherman](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/abe.sherman/32/11260_2.png) [@abe.sherman](https://community.glideapps.com/u/abe.sherman)\
**Post date:** [February 24, 2021, 3:58am UTC](https://community.glideapps.com/t/time-stamp-update/1382/83 "2021-02-24T03:58:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 24, 2021, 4:08am UTC](https://community.glideapps.com/t/time-stamp-update/1382/84 "2021-02-24T04:08:55Z")

</div>

Okay, done. Here’s the modified function:

```auto
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);
}

```

---

<div class="post-metadata">

**Author:** ![abe.sherman](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/abe.sherman/32/11260_2.png) [@abe.sherman](https://community.glideapps.com/u/abe.sherman)\
**Post date:** [February 24, 2021, 4:24am UTC](https://community.glideapps.com/t/time-stamp-update/1382/85 "2021-02-24T04:24:36Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/6/363e968fb221b493ebc76c8339af3bb067f0494d.png)

---

<div class="post-metadata">

**Author:** ![Daniel\_Gjode](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/daniel_gjode/32/47347_2.png) [@Daniel\_Gjode](https://community.glideapps.com/u/Daniel_Gjode)\
**Post date:** [August 17, 2022, 3:56pm UTC](https://community.glideapps.com/t/time-stamp-update/1382/86 "2022-08-17T15:56:14Z")

</div>

Hi ThinDinh,

This is great! I was wondering if this could also be done in a GlideTable?

Thanks,  
Daniel

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [August 17, 2022, 11:49pm UTC](https://community.glideapps.com/t/time-stamp-update/1382/87 "2022-08-17T23:49:35Z")

</div>

If you want it for a checkbox, you would have to do it in an edit screen.

- Create a user-specific column called “Checkbox temporary”. I’ll call the real checkbox column “Checkbox real” from this point.

- Create a normal timestamp column to store the time of the change, let’s call it “Timestamp change”.

- Create a button with the custom action being:

1st, set column: set the value of “Checkbox real” to “Checkbox temporary”.  
2nd, show edit screen.

- Add a switch pointing to “Checkbox temporary”.

- Add an “on submit” action, only run it if “Checkbox temporary” is not the same as “Checkbox real”:

Set column: set the “current time” special value to the “Timestamp change” column, and set the “Checkbox temporary” value to the “Checkbox real” column.

This will work when you want to have a timestamp for specific changes to one column.

If you want multiple columns, then the flow might be harder. Let me know if you want that and we can brainstorm for a solution.

[Previous page](https://community.glideapps.com/t/time-stamp-update/1382.md?page=4)
