Jan 10, 2023 10:14 AM
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!
Solved! Go to Solution.
Jan 10, 2023 12:57 PM
If you make a new column called "Date Created", all you need to do is make it a formula, which is simply
Jan 10, 2023 12:32 PM
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.
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.
Jan 10, 2023 12:57 PM
If you make a new column called "Date Created", all you need to do is make it a formula, which is simply
Jan 10, 2023 01:35 PM
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().
Jan 10, 2023 02:25 PM
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.