Is there any way to prefill a form with the current date?
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:
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:
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:
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?
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.
It would be good to have a way to do this.
I have not succeeded using prefill_ on a form for a date field.
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?
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?
I did not see a simple way to filter records that were created from public forms so I decided to use a different field on the form vs in my datasheet view. Filtering public form records was the primary purpose of the {Form Date}.