Need help creating a timestamp that doesn't change once entered like now() does

I have a check box column and then I have a column next to it where I want the timestamp to be entered on when the box was checked. I was able to get it to work with now() in the formula, but that date and time is not maintained, but instead stays current which I guess is the point of the now() formula. I have also attempted modified() in the formula, but then it puts a date/time in every row of the column not just the ones that have been checked. How do I get it so when the box is checked the current date and time is entered in the second column, but remains static and the rows where the box is not checked remains blank? I was wondering if maybe it would be possible to use the now() formula to get the current date/time and then have it converted to text so it doesn’t change?

Any help would be appreciated.

Hello @Jennifer_Biggs!
Seems like the perfect use for a button! You can create a button column that checks your checkbox column and at the same time writes the timestamp.
I leave a Coda with an example:

4 Likes

@Saul_Garcia , very nice usage of the button logic with the icons in it and

ModifyRows(thisRow, Tasks.Done, thisRow.Done.Not(), Tasks.Timestamp, If(thisRow.Done,"",Now()))

works perfect for the Now() ´function is inserted as plain text, so won’t change anymore. This is one of the things I really like about buttons, the output is always plain text.

1 Like

And once you want to reuse the timestamp data again, it is easily done since the data is already structured properly by adding the ToDate() function and if you want to substract from this day Today() you can write it as below

`today() - thisRow.Timestamp.ToDate()

The data I often get in as text is structured in a EU format. If that is the case I have to bring it back to the ‘source format’ which is month,day, year (mm,dd,yyyy) and I use a formula like the one below:

Concatenate(thisRow.[Created at].Split("-").Nth(2),"/",thisRow.[Created at].Split("-").Nth(1),"/",thisRow.[Created at].Split("-").nth(3)).Todate()

The reordering of data takes place via the Nth() Via Split() I turn the text string into a list and each position in a list can be pointed to via Nth()

2 Likes

Thank you so much for your help. I really appreciate it. I was able to get this to work in my document. I do have a question on how you got the checked box and the clear box into the label of the button? I was able to copy and paste what you had, but I wasn’t able to figure out how to get any other image in the label field. I tried copying and pasting another image, but it didn’t work. I even tried copying the icons from within Coda, but that didn’t seem to work either. So can you please explain how you did that?

Thanks

1 Like

Hello @Jennifer_Biggs ,
The easiest way to do that is:

  • make sure the cursor is somewhere on the canvas
  • go to the top menu of coda and click on the emoticon icon
  • find the icon you want to use and click on it
  • now it sits on the desktop
  • copy it, edit your button properties and paste it in the label field
    That is all there is to it. You can paste more than one icon.
2 Likes

Thanks for the help. That is just what I needed.

1 Like