Hello everyone. After using the date & time node, I get “Invalid date” within the data, instead of an empty string (for those that were empty before). It is making the API call throw an error. Any idea how to rid of this?
Error Message Reads (from Hubspot node): ERROR: Bad request - please check your parameters
Property values were not valid…“message”: "400 - {“validationResults”:[{“isValid”:false,“message”:“Invalid date was not a valid long.”,“error”:“INVALID_LONG”,“name”:“expires_on”}
`{
"nodes": [
{
"parameters": {
"keys": {
"key": [
{
"currentKey": "first_name",
"newKey": "firstname"
},
{
"currentKey": "last_name",
"newKey": "lastname"
},
{
"currentKey": "birthdate",
"newKey": "date_of_birth"
},
{
"currentKey": "address1",
"newKey": "address"
}
]
}
},
"name": "Rename Keys",
"type": "n8n-nodes-base.renameKeys",
"typeVersion": 1,
"position": [
780,
1120
]
},
{
"parameters": {
"value": "={{$json[\"expires_on\"]}}",
"dataPropertyName": "expires_on",
"toFormat": "x",
"options": {
"fromFormat": "=YYYY-MM-DD",
"fromTimezone": "US/Eastern",
"toTimezone": "US/Eastern"
}
},
"name": "Expire on",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 1,
"position": [
540,
1140
]
},
{
"parameters": {
"functionCode": "let results = [];\n\nfor (const [key, value] of Object.entries(items[0].json)) {\n results.push({\n json: value\n })\n}\n\nreturn results;"
},
"name": "Entry Results",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
-660,
1120
]
},
{
"parameters": {
"authentication": "digestAuth",
"url": "https://www.traillifeconnect.com/api/hubspot?type=users&update=2022-03-11",
"options": {}
},
"name": "HTTP Request3",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
-840,
1120
]
},
{
"parameters": {
"triggerTimes": {
"item": [
{
"mode": "everyX",
"value": 5,
"unit": "minutes"
}
]
}
},
"name": "Cron1",
"type": "n8n-nodes-base.cron",
"position": [
-1020,
1120
],
"typeVersion": 1
},
{
"parameters": {
"operation": "limit",
"maxItems": 10,
"keep": "lastItems"
},
"name": "Item Lists2",
"type": "n8n-nodes-base.itemLists",
"typeVersion": 1,
"position": [
-440,
1120
]
},
{
"parameters": {
"value": "= {{$json[\"background_check_on\"]}}\nif (isEmptyObject(query)) {\n // There are no queries.\n} else {\n // There is at least one query,// or at least the query object is not empty.\n}",
"dataPropertyName": "background_check_on",
"toFormat": "x",
"options": {
"fromFormat": "=YYYY-MM-DD"
}
},
"name": "Background Check1",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 1,
"position": [
360,
1120
]
},
{
"parameters": {
"value": "={{$json[\"updated_at\"]}}",
"dataPropertyName": "=updated_at",
"toFormat": "=x",
"options": {
"fromTimezone": "US/Eastern",
"toTimezone": "US/Eastern"
}
},
"name": "updated at1",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 1,
"position": [
-240,
1120
]
},
{
"parameters": {
"value": "={{$json[\"ypt_completed_on\"]}}",
"dataPropertyName": "ypt_completed_on",
"toFormat": "x",
"options": {
"fromFormat": "=YYYY-MM-DD",
"fromTimezone": "US/Eastern",
"toTimezone": "US/Eastern"
}
},
"name": "ypt completed1",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 1,
"position": [
160,
1120
]
},
{
"parameters": {
"value": "={{$json[\"certified_on\"]}}",
"dataPropertyName": "certified_on",
"toFormat": "x",
"options": {
"fromFormat": "=YYYY-MM-DD",
"fromTimezone": "US/Eastern",
"toTimezone": "US/Eastern"
}
},
"name": "certified on1",
"type": "n8n-nodes-base.dateTime",
"typeVersion": 1,
"position": [
-40,
1120
]
},
{
"parameters": {
"operation": "limit",
"maxItems": 5,
"keep": "lastItems"
},
"name": "Item Lists3",
"type": "n8n-nodes-base.itemLists",
"typeVersion": 1,
"position": [
1040,
1140
]
}
],
"connections": {
"Rename Keys": {
"main": [
[
{
"node": "Item Lists3",
"type": "main",
"index": 0
}
]
]
},
"Expire on": {
"main": [
[
{
"node": "Rename Keys",
"type": "main",
"index": 0
}
]
]
},
"Entry Results": {
"main": [
[
{
"node": "Item Lists2",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request3": {
"main": [
[
{
"node": "Entry Results",
"type": "main",
"index": 0
}
]
]
},
"Cron1": {
"main": [
[
{
"node": "HTTP Request3",
"type": "main",
"index": 0
}
]
]
},
"Item Lists2": {
"main": [
[
{
"node": "updated at1",
"type": "main",
"index": 0
}
]
]
},
"Background Check1": {
"main": [
[
{
"node": "Expire on",
"type": "main",
"index": 0
}
]
]
},
"updated at1": {
"main": [
[
{
"node": "certified on1",
"type": "main",
"index": 0
}
]
]
},
"ypt completed1": {
"main": [
[
{
"node": "Background Check1",
"type": "main",
"index": 0
}
]
]
},
"certified on1": {
"main": [
[
{
"node": "ypt completed1",
"type": "main",
"index": 0
}
]
]
}
}
}`
- **Running desktop app