Help

Re: Automation: Create new record with today's date

Solved
Jump to Solution
5192 0
cancel
Showing results for 
Search instead for 
Did you mean: 
beczap
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi, I need some help in creating an automation. My goal is when I create a new record in my Projects tab, it automatically adds today's date in the "Date Created" column. I've been looking into using an update record automation or a TODAY() formula, but I can't seem to get it to work. Any help appreciated!

1 Solution

Accepted Solutions
Ron_Daniel
8 - Airtable Astronomer
8 - Airtable Astronomer

If you make a new column called "Date Created", all you need to do is make it a formula, which is simply

CREATED_TIME()

If you want to format the date, just encapsulate that in Datetime Format. For example, if you wanted it to say 01/10/2023, you'd use
DATETIME_FORMAT(CREATED_TIME(),'MM-DD-YYYY')

Here is a list of all the format specifiers:
https://support.airtable.com/docs/supported-format-specifiers-for-datetime-format
 

See Solution in Thread

4 Replies 4

Time and dates can be a little tricky at first - it took me awhile to figure out the correct Javascript Time/Date syntax, mixed in with how Airtable expects and interprets dates be it in Scripting App Extension or an Automation Script.

Firstly, get to know Date objects in Javascript. I run a free app called VS Code, and also a JavaScript Plugin called Quokka that gives me instant results from my Javascript as I type. This morning, I wrote this table to help me figure out why one of my dates in Airtable was screwing up. It became an exercise in "What does time look like" 😂 as I tabulated the results.

Karlstens_0-1673382281250.png

But from understanding how this JavaScript works, I can now take these methods into an Airtable Automation and hopefully push the correct data into Date fields.

Regarding Airtable Date fields, there's a couple of catches.

If your Date field is showing without time, then Airtable will show GMT time at 00:00. I often have to *think* when dealing with this simple Date column, as I typically need it to show a date that's 11 hours ahead, so typically I'm putting in tomorrows GMT date into a Date only field thanks to my local timezone.

If your Date field is showing both Date and Time, then Airtable will be time specific and a little easier to work with, as you can feed it the GMT date/time but then show it in your local time via the Field options.

Also, a side note, you shouldn't need to worry about using a formula field with dates - there may be exceptions where it might make life easier/or act as a workaround, but typically I write all my date formatting code in the script and not in an accompanying formula field.

Regarding your Automation idea, this is a great project and hopefully you'll learn lots.

 

Ron_Daniel
8 - Airtable Astronomer
8 - Airtable Astronomer

If you make a new column called "Date Created", all you need to do is make it a formula, which is simply

CREATED_TIME()

If you want to format the date, just encapsulate that in Datetime Format. For example, if you wanted it to say 01/10/2023, you'd use
DATETIME_FORMAT(CREATED_TIME(),'MM-DD-YYYY')

Here is a list of all the format specifiers:
https://support.airtable.com/docs/supported-format-specifiers-for-datetime-format
 
KijaniBeau
4 - Data Explorer
4 - Data Explorer

RonDaniel's solution should work too, but you can also set up a trigger so whenever a form is submitted, it updates the record in the Date Created column to be TODAY(). 

beczap
5 - Automation Enthusiast
5 - Automation Enthusiast

Thank you—these are all helpful! @Ron_Daniel I used your solution and it worked well! I hope eventually they add the option in an automation to change the record to the date created, instead of picking a specific date.