Getting data from NocoDB and PosrtgreSQL.
The dates are compared in the IF node.
For NocoDB {{ DateTime.fromSQL($json.DateTimeAction) }} works as expected,
For PostgreSQL {{ DateTime.fromISO($json[“lastPublishedDate”]) }} }} gives the error ERROR: The provided value 1 ‘Invalid DateTime’ in condition 1 cannot be converted to the expected type ‘dateTime’ [item 0].
ERROR: The provided value 1 ‘Invalid DateTime’ in condition 1 cannot be converted to the expected type ‘dateTime’ [item 0]
Try to change the operator, or change the type with an expression
Details
Time
13.02.2024, 10:57:50
Stack
NodeOperationError: The provided value 1 'Invalid DateTime' in condition 1 cannot be converted to the expected type 'dateTime' [item 0]
at extractValue (/app/code/node_modules/n8n-core/src/ExtractValue.ts:205:9)
at getNodeParameter (/app/code/node_modules/n8n-core/src/NodeExecuteFunctions.ts:2305:28)
at Object.getNodeParameter (/app/code/node_modules/n8n-core/src/NodeExecuteFunctions.ts:3457:12)
at /app/code/node_modules/n8n-nodes-base/nodes/If/V2/IfV2.node.ts:77:18
at Array.forEach (<anonymous>)
at Object.execute (/app/code/node_modules/n8n-nodes-base/nodes/If/V2/IfV2.node.ts:69:23)
at Workflow.runNode (/app/code/node_modules/n8n-workflow/src/Workflow.ts:1324:31)
at /app/code/node_modules/n8n-core/src/WorkflowExecute.ts:1046:44
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at /app/code/node_modules/n8n-core/src/WorkflowExecute.ts:1722:11
If you disable the “Return All” button in the Postgres node and receive only a small portion of the results, would be the error the same? If so, can you please attach the sample of data to check?
Good afternoon. I limited it to 10 records, the error persists. At the same time, if you run the whole process, the error is there. If you go to the IF node after that and click Test Step there, everything is processed.
This was also described in the topic
Yes, seems like a bug. And it can’t be reproduced with pinned data. So to reproduce it, there should be set a PostgresDB. You can avoid the issue if you place the Code node right after the Postgres Node which will output the same.