*How to Handle a Null / Empty / Blank Date Field in Airtable Node?

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.

:x: If I send an empty string (""), it results in an error.
:x: If I send null or undefined, it still doesn’t work.
:x: 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! :blush:

:loudspeaker: 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.

:point_right: My Solution:

javascript

{{ DateTime.fromFormat($json.Rechnungsdatum, "dd-MM-yyyy").toISODate() }}

:arrow_forward: This converts a valid date into the YYYY-MM-DD format that Airtable accepts.


:hammer_and_wrench: 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.

:bulb: Works even with empty values

1 Like