Skip to main content
Solved

Appending row with date field


Forum|alt.badge.img+2

Hi,

I use n8n to do some automated data collection that i want to store in the Aritable.

I get the current date in the n8n with the code

 

var data = DateTime.now().toFormat('dd/M/yyyy'); return { json: {Date: data} }

 

the output is 

 

[ { "Date": "27/6/2023" } ]

 

 The format seems to be valid, due to the airtable date documentation 

 

As the next step, i add some extra data and append it to the table, i get the error

 

Cannot parse date value "27/6/2023" for field Date

 

 That is super confusing because the format is exactly as in the documentation: 

{name: 'european', format: 'D/M/YYYY'

 

Best answer by Vitalii

This one worked fine:

 

var data = DateTime.now().toFormat('M/dd/yyyy'); return { json: {Date: data} }

 

 The data is:

 

[ { "Date": "6/27/2023" } ]

Still wondering why, as both formats should work fine, due to the documentation

 

View original
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+2
  • Author
  • New Participant
  • 3 replies
  • June 27, 2023

I've simplified the case and try to append the date only:

[ { "Date": "27/6/2023" } ]

Still getting the same error

ERROR: Your request is invalid or could not be processed by the service Cannot parse date value "27/6/2023" for field Date

Forum|alt.badge.img+2
  • Author
  • New Participant
  • 3 replies
  • Answer
  • June 27, 2023

This one worked fine:

 

var data = DateTime.now().toFormat('M/dd/yyyy'); return { json: {Date: data} }

 

 The data is:

 

[ { "Date": "6/27/2023" } ]

Still wondering why, as both formats should work fine, due to the documentation

 


Reply