Nov 23, 2017 07:43 AM
I have a ‘Date’ field. 99% of the time it is the current date. It seems that I can’t set a default value to appear in the form field (which seems like a major omission). Can I use the form prefill to do this? I tried this:
https://airtable.com/1234?prefill_Date=TODAY()
and
https://airtable.com/1234?prefill_Date=TODAY
But it didn’t understand “TODAY” or “TODAY()”.
Nov 27, 2017 02:28 PM
Surely there must be some way I can default a date field to the current date in a form?
Apr 12, 2018 10:43 AM
I ran into the same problem today and found your post. I was able to work around my issue in the source-code for my web app, where I have my form links embedded.
If you have access to the source-code, you may be able to get around this in a similar fashion.
My app is a Ruby on Rails app, so in the controller for the page I have my links embedded in, I just made an instance variable @today = DateTime.now
which will be available to that view.
Then in the view, I interpolated that variable into the link URL like so:
<a href="...airtable.com/12345?prefill_Date=<%= @today %>"></a>
This worked for me - notice the URL and the pre-filled Date field:
I’m afraid I can’t be of much help for frameworks other than Ruby on Rails, but hopefully this points you in the right direction :winking_face:
May 25, 2018 08:22 AM
As of today (5/25/2018), https://airtable.com/1234?prefill_Date=TODAY worked! That will be a big help on my forms!
Jun 05, 2018 02:13 AM
Thanks Jeremy. In the end I did something similar with Javascript.
Aug 16, 2018 02:53 PM
Are you sure this works? I couldn’t get it to prefill for me. If so, can you share an example? Or perhaps how you’ve set up your date field maybe?
Aug 28, 2018 04:31 PM
I got around this by creating a prefill form condition called “now” that triggers zapier to update the date/time field to the time the record was submitted.
Mar 10, 2019 10:17 PM
It would be good to have a way to do this.
Oct 15, 2019 12:34 AM
I have not succeeded using prefill_ on a form for a date field.
Here is what I am doing:
-Input Date field for data entry within AirTable.
-Form Date field for data entry with Forms.
-CreateDate = Created time field type
-Date =
IF({Input Date},{Input Date},IF({Form Date},{Form Date},{Create Date}))
Oct 15, 2019 12:44 PM
It’s important to note that the tip from @Jeremy_Oglesby above works in Ruby on Rails. If you’re trying to use his syntax directly in a URL to an Airtable form, it won’t work.
The details you list tell part of the story of how your fields operate, but what’s not clear (to me, at least) is more of the logic behind their operation. The detail of the {Date}
field formula partly covers this, but part of it admittedly still confuses me, namely the inclusion of the {Create Date}
field. {Input Date}
appears to be the preference when someone is directly entering data into Airtable. If that’s not there, it falls back to {Form Date}
, which is (guessing) a date that the user manually enters into a form (which might also be the one that you’re trying to auto-fill…maybe?). If that date is missing, the final fallback is {Create Date}
, which will be there no matter what when the record is created.
Because you will always have a date in {Create Date}
, I’m not sure that I understand the logic of including the other date fields at all. When the user does manual entry in Airtable, you’ll have that date. When the form is filled out, you’ll also have that date. It feels like {Input Date}
and {Form Date}
are unnecessary. Am I missing something?