"Results Column" as a timestamp for Slack Messages

Hey folks,

I have a button that posts a message to a Slack channel, and am using the “Results column” to post results to a new field. What is the format of the data put into that field? It appears to be a string of numbers (ex: 1724222760.392839) and I can’t from changing the format of the field to see what it actually is.

Ideally I wanted the results to be a timestamp of the message; or find another way to click 1 button and get both a Slack message AND a timestamp updated in another field.

1 Like

Hi @Erica_Anderson

If I’m not mistaken, this value is in UNIX epoch format, which represents a timestamp in seconds relative to a date that I can’t recall at the moment.

I entered the value you provided into this converter, and it returned:
GMT : Wednesday, 21 August 2024 06:46:00.392

So, it seems that you are getting the timestamp right.
Another approach is to explicit use a formula inside the button. To run more than one action, you can use RunActions(). In the first field of the formula you put the slack formula and the second one you use the AddRow() or AddOrModifyRows() formulas, so you can add or modify any field of any table in your doc with some data.

Best regards,
Arnhold

1 Like

Coda has built-in functions for working with epoch time! :slight_smile:

  • EpochToDate()
  • DateToEpoch()

image

1 Like

Amazing! You know, I did think it looked like something familiar; I am embarrassed to say I didn’t think of epoch format.

If this value is being posted to a field as a result of the Slack result column setting - is there a way to add a formula to that field to convert any value in it to epoch? I can’t reference the field variable because it his a circular reference. :thinking:

epoch to date: EpochToDate(0): 1/1/1970 1:00 AM

2 Likes