The if node did not work

{
“nodes”: [
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “9433f48d-5d38-4408-b962-b9a74bf37ade”,
“leftValue”: “={{ $json.body.data.from }}”,
“rightValue”: “={{ $json.body.data.to }}”,
“operator”: {
“type”: “string”,
“operation”: “notEquals”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.3,
“position”: [
992,
-592
],
“id”: “4337a907-9e3d-4bdd-8743-4fb20981c852”,
“name”: “判断收方和发送方”
}
],
“connections”: {
“判断收方和发送方”: {
“main”: [
,

]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “26639e3437755518881b33f821ef4f87fb6ea89aaceee8d858fef934df9fd2d8”
}
}

This is my if statement. My current problem is:

My initial setting is to ship from the true branch when the sender and recipient are not equal, but the result is that it ships from the true branch regardless of whether the sender and recipient are equal.

When I change it to a ‘equality’ check, it ships from the false branch regardless of whether they are equal.

{
“nodes”: [
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “e9072470-76ad-46d7-855f-46d216b6b5b6”,
“leftValue”: “={{ $(‘接收信息’).item.json.body.data.to }}”,
“rightValue”: “={{ $(‘接收信息’).item.json.body.data.from }}”,
“operator”: {
“type”: “string”,
“operation”: “equals”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.3,
“position”: [
1024,
-640
],
“id”: “69d0931d-1997-453f-8f13-e0ddd805e642”,
“name”: “If1”
}
],
“connections”: {
“If1”: {
“main”: [
,

]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “26639e3437755518881b33f821ef4f87fb6ea89aaceee8d858fef934df9fd2d8”
}
}

Currently, I’m using this if node, and it successfully transmits identical numbers from the true branch and different numbers from the false branch.

I’m an enthusiast and I don’t know anything about programming. I would be extremely grateful if someone could tell me the problem with these two lines of code.

Hello

Benjamin_Behrens
It’s nice to see you again, and thank you so much for your help again.

The workflow is now working correctly.

I’ve identified the real problem with my workflow: it’s sending the message to my own account simultaneously. I think the issue might be with the trigger.

My deduction is as follows: After the HTTP message is sent, it’s being pushed back to the webhook as a new message. So even with the IF filter, the order of from and to in the data might be reversed, or the data structure might be different, causing the IF statement to fail.

If this is the problem, how can I test and resolve it?

大多數 if 節點問題來自資料類型不匹配。來自上一個節點的值通常是字串,例如「true」,但 if 節點是將其比較為布林值 true。開啟 if 節點上的輸入面板,並檢查該值的實際類型。如果它是字串,請將比較變更為字串等於「true」,或在其前面新增一個 set 節點以將值轉換為正確的類型。