Hi everyone,
I’m facing an issue with the Airtable Node in n8n when dealing with date fields.
- In some cases, the date field has a value and needs to be saved in Airtable.
- In other cases, the date field is empty or not provided – and that’s where the issue occurs.
If I send an empty string (""
), it results in an error.
If I send null
or undefined
, it still doesn’t work.
00.00.0000
is also invalid.
Expected behavior:
- If there is a valid date → Save it in Airtable.
- If the date is missing → The field should remain blank in Airtable without causing an error.
What is the best way to handle this in n8n?
Should I remove the field from the request dynamically? Or is there another workaround?
Thanks for any help! 
Solution for Luxon DateTime.fromFormat()
in n8n with different date formats!
I had an issue where my data was either in the format “dd-MM-yyyy” or “dd.MM.yyyy”, but Airtable only accepts a properly formatted YYYY-MM-DD
date.
My Solution:
javascript
{{ DateTime.fromFormat($json.Rechnungsdatum, "dd-MM-yyyy").toISODate() }}
This converts a valid date into the YYYY-MM-DD
format that Airtable accepts.
How does this work?
DateTime.fromFormat($json.Rechnungsdatum, "dd-MM-yyyy")
→ Converts the date string from the "dd-MM-yyyy"
format into a Luxon DateTime
object.
.toISODate()
→ Converts the DateTime
object into the ISO format (YYYY-MM-DD
), which Airtable can store correctly.
Works even with empty values
1 Like
system
Closed
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.