-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If node will return true / false wrongly if empty new line after JavaScript #12237
Labels
in linear
Issue or PR has been created in Linear for internal review
Comments
Hey @itsimonchan, We have created an internal ticket to look into this which we will be tracking as "N8N-7972" |
Joffcom
added
the
in linear
Issue or PR has been created in Linear for internal review
label
Dec 15, 2024
Can you please provide a sample workflow. Sadly, I have not been able to replicate the issue. I used the workflow below in version
|
Dear Ricardo,
My workflow is attached.
It runs smoothly if there is no extra new line.
[image: image.png]
However, if I append a new line (yes, it's my fat finger), then it will
return error this time.
[image: image.png]
I also just upgraded n8n to 1.71.3 and 1.72.1 with the same result.
[image: image.png]
Regards,
Simon Chan
Ricardo Espinoza ***@***.***> 於 2024年12月20日 週五 上午8:08寫道:
… Can you please provide a sample workflow. Sadly, I have not been able to
replicate the issue. I used the workflow below in version 1.73.0
{
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-360,
-80
],
"id": "620ededf-7783-48d2-948a-9b21baa05a0e",
"name": "When clicking ‘Test workflow’"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "fd6a5c95-197f-4472-9eba-fa5e5d8f8610",
"leftValue": "={{\nDateTime.isDateTime($json.start) && \nDateTime.isDateTime($json.end)\n\n}}",
"rightValue": "true",
"operator": {
"type": "boolean",
"operation": "false",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
120,
-80
],
"id": "ada4206c-6a4c-45eb-beaa-db3101ed3ca5",
"name": "If"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "c1e31e2e-4299-43a2-aa02-11f2d4eb98af",
"name": "start",
"value": "={{ $now }}",
"type": "string"
},
{
"id": "ab376efe-1b69-4a38-a8d6-5b8f83e092fc",
"name": "end",
"value": "={{ $now }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-100,
-80
],
"id": "ad65e6ae-5f55-482f-a5bb-2121c97ccb8e",
"name": "Edit Fields"
}
],
"connections": {
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"If": {
"main": [
[]
]
},
"Edit Fields": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {}
}
—
Reply to this email directly, view it on GitHub
<#12237 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BHUIRNIZ2GS6XGPDOVK7KBD2GNNW5AVCNFSM6AAAAABTUURMFWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNJVHE4DSMZRHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
A JavaScript formula which should return nothing in True Branch will shows all results in True Branch if there is at least 1 new line (enter) appended after code
To Reproduce
JavaScript code:
{{
$json["start"].dateTime &&
new Date($json["start"].dateTime).getTime() > new Date().getTime() &&
new Date($json["start"].dateTime).getTime() - new Date().getTime() <= 30 * 60 * 1000
}}
Expected behavior
True branch will show only what should be true.
Operating System
Zeabur
n8n Version
1.71.3
Node.js Version
Not sure (Managed by Zeabur)
Database
PostgreSQL
Execution mode
main (default)
The text was updated successfully, but these errors were encountered: