Help

Re: Appending row with date field

Solved
Jump to Solution
925 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Vitalii
5 - Automation Enthusiast
5 - Automation Enthusiast

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'

 

1 Solution

Accepted Solutions
Vitalii
5 - Automation Enthusiast
5 - Automation Enthusiast

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

 

See Solution in Thread

2 Replies 2
Vitalii
5 - Automation Enthusiast
5 - Automation Enthusiast

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
Vitalii
5 - Automation Enthusiast
5 - Automation Enthusiast

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