Notion date invalid (from google)

HI,

from googlesheet row, create Notion database page
My problem is with dates.
ERROR: 400 - {“object”:“error”,“status”:400,“code”:“validation_error”,“message”:“body failed validation: body.properties.DO date.date.start should be a valid ISO 8601 date string, instead was \"Invalid date\".”}
By default, I tend to use dd/mm/yyyy, but I tried some others with no more success.
Tried to set date to a string, a number. valid in set, not valid in Notion
Tried format a date ( "successfully " given “invalid data”, yeah!)

{
“nodes”: [
{
“parameters”: {},
“name”: “Start”,
“type”: “n8n-nodes-base.start”,
“typeVersion”: 1,
“position”: [
240,
300
]
},
{
“parameters”: {
“sheetId”: “1hWi0vmevVBynrUcvH2U6HZHCr2QC9ysDyYz2-6Z3bv8”,
“range”: “testNotionActions!A:Z”,
“dataStartRow”: 2,
“keyRow”: 2,
“options”: {
“continue”: true,
“valueRenderMode”: “FORMATTED_VALUE”
}
},
“name”: “Google Sheets”,
“type”: “n8n-nodes-base.googleSheets”,
“typeVersion”: 1,
“position”: [
460,
300
],
“credentials”: {
“googleApi”: {
“id”: “6”,
“name”: “Google account”
}
}
},
{
“parameters”: {
“resource”: “databasePage”,
“databaseId”: “69e7ba98-1d46-41c7-b27d-2e051a145246”,
“title”: “={{$node["Google Sheets"].json["STA-GUE-23-A1-trouver transport co si besoin"]}}”,
“propertiesUi”: {
“propertyValues”: [
{
“key”: “DO date|date”,
“includeTime”: false,
“date”: “={{$node["Set"].json["date-nombre"]}}”
},
{
“key”: “Domaine|multi_select”,
“multiSelectValue”: [
“STA”
]
}
]
},
“blockUi”: {
“blockValues”: [
{
“textContent”: “={{$node["Google Sheets"].json["Dans ce paragraphe nous pouvons ecrire ce qu’il faut faire precisement. "]}}”
}
]
}
},
“name”: “Notion”,
“type”: “n8n-nodes-base.notion”,
“typeVersion”: 2,
“position”: [
840,
300
],
“credentials”: {
“notionApi”: {
“id”: “4”,
“name”: “Notion account”
}
}
},
{
“parameters”: {
“value”: “={{$node["Google Sheets"].json["16-09-2022"]}}”,
“dataPropertyName”: “date”,
“options”: {
“fromFormat”: “={{$node["Google Sheets"].json["16-09-2022"]}}”
}
},
“name”: “Date & Time”,
“type”: “n8n-nodes-base.dateTime”,
“typeVersion”: 1,
“position”: [
280,
500
]
},
{
“parameters”: {
“values”: {
“number”: [
{
“name”: “date-nombre”,
“value”: “={{$node["Google Sheets"].json["16-09-2022"]}}”
}
]
},
“options”: {
“dotNotation”: false
}
},
“name”: “Set”,
“type”: “n8n-nodes-base.set”,
“typeVersion”: 1,
“position”: [
640,
420
]
}
],
“connections”: {
“Google Sheets”: {
“main”: [
[
{
“node”: “Set”,
“type”: “main”,
“index”: 0
}
]
]
},
“Set”: {
“main”: [
[
{
“node”: “Notion”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}. →

Describe the issue/error/question

What is the error message (if any)?

Please share the workflow

(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:

Hi @Joel_T

It seems you need to put in an ISO string.
so yyyy-mm-dd
have you tried that?

yes an iso 8601, added a node date format, tried every format tried some customs formats too. still invalid ( this is the “succesfully executed” with invalid data )

done it again
{
“nodes”: [
{
“parameters”: {
“sheetId”: “1hWi0vmevVBynrUcvH2U6HZHCr2QC9ysDyYz2-6Z3bv8”,
“range”: “testNotionActions!A:Z”,
“dataStartRow”: 2,
“keyRow”: 2,
“options”: {
“continue”: true,
“valueRenderMode”: “FORMATTED_VALUE”
}
},
“name”: “Google Sheets”,
“type”: “n8n-nodes-base.googleSheets”,
“typeVersion”: 1,
“position”: [
240,
280
],
“credentials”: {
“googleApi”: {
“id”: “6”,
“name”: “Google account”
}
}
},
{
“parameters”: {
“resource”: “databasePage”,
“databaseId”: “69e7ba98-1d46-41c7-b27d-2e051a145246”,
“title”: “={{$node["Google Sheets"].json["STA-GUE-23-A1-trouver transport co si besoin"]}}”,
“propertiesUi”: {
“propertyValues”: [
{
“key”: “DO date|date”,
“includeTime”: false,
“date”: “={{$node["Set"].json["date-nombre"]}}”
},
{
“key”: “Domaine|multi_select”,
“multiSelectValue”: [
“STA”
]
}
]
},
“blockUi”: {
“blockValues”: [
{
“textContent”: “={{$node["Google Sheets"].json["Dans ce paragraphe nous pouvons ecrire ce qu’il faut faire precisement. "]}}”
}
]
}
},
“name”: “Notion”,
“type”: “n8n-nodes-base.notion”,
“typeVersion”: 2,
“position”: [
560,
280
],
“credentials”: {
“notionApi”: {
“id”: “4”,
“name”: “Notion account”
}
}
},
{
“parameters”: {
“value”: “={{$node["Google Sheets"].json["16-09-2022"]}}”,
“dataPropertyName”: “date”,
“toFormat”: “YYYY-MM-DD”,
“options”: {
“fromFormat”: “={{$node["Google Sheets"].json["16-09-2022"]}}”
}
},
“name”: “Date & Time”,
“type”: “n8n-nodes-base.dateTime”,
“typeVersion”: 1,
“position”: [
420,
400
]
}
],
“connections”: {
“Google Sheets”: {
“main”: [
[
{
“node”: “Date & Time”,
“type”: “main”,
“index”: 0
}
]
]
},
“Date & Time”: {
“main”: [
[
{
“node”: “Notion”,
“type”: “main”,
“index”: 0
}
]
]
}
}
}

please put your code in a preformatted text block. :slight_smile:

what is a preformated block ? and how ?

Ok so your setup of the date & time node doesnt look right.
Can you check out this example and see if you can fix it with that?
https://n8n.io/workflows/1744/


The from format needs to be changed like this.
and the value you got doesn’t seem right, did you drag the field into the field from the input? (depending on what version you are using you can do this)

value is from Gs, a date ( inthe future, not now)
I needed the option “from format” {{gsheet…}} in order for n8n to recognize the value
Ha I see your second answer…

1 Like

not sure about that last part.

The from format is the format that the data is in at the moment before converting it.
So that would be DD-MM-YYYY in your case if I see it correctly.
The Value is the value you need to get from the google sheet node. But now it doesn’t seem right, unless the column name is actually a date.
this should be something like {{$json[“datecolumn”]}} in the expression

Yes, solved, thanks.
all the Gs and notion cells where dates.
Gs was dd-mm-yyyy, I’ll try dd/mm/yyy ( more convenient for me)

1 Like