Describe the problem/error/question
We are trying to handle this IF Node and we trying different things and it seems it’s a bug or something that we miss.
Basically, we need to handle the query result either returning value or nothing. For some reason, the output always returning TRUE if it’s blank.
What is the error message (if any)?
N/A
Please share your workflow
{
“nodes”: [
{
“parameters”: {
“operation”: “executeQuery”,
“query”: “SELECT Batch_ID, Listing_ID\nFROM dc_ai_content_moderation\nWHERE Batch_ID = {{ $json.Batch_ID }} AND Sentiment_Analysis_Category IN (‘Chemicalsss Drug Content’, ‘Gun Content’, ‘Fraud Content’) AND Sentiment_Analysis_Confidence >= 0.50”,
“options”: {}
},
“type”: “n8n-nodes-base.mySql”,
“typeVersion”: 2.4,
“position”: [
-1320,
460
],
“id”: “7800f1a7-dab6-4a35-ad34-3697008e91e5”,
“name”: “Get Non-Adult-OK Content with AI High Confidence”,
“executeOnce”: true,
“alwaysOutputData”: true,
“credentials”: {
“mySql”: {
“id”: “76mb9Wbc7PAKkPhK”,
“name”: “MySQL account”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “loose”,
“version”: 2
},
“conditions”: [
{
“id”: “4f5dd8f0-a123-4e14-9bd2-774d3c6a23d5”,
“leftValue”: “={{ $json.debug_boolean_check }}\n\n\n\n\n\n\n\n”,
“rightValue”: true,
“operator”: {
“type”: “boolean”,
“operation”: “equals”
}
}
],
“combinator”: “or”
},
“looseTypeValidation”: true,
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
-920,
460
],
“id”: “86987cce-ff4d-457a-be54-744274a95ae0”,
“name”: “If1”
},
{
“parameters”: {},
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
-1760,
460
],
“id”: “0b749aa3-259a-48b3-bdb0-6d3858becc3f”,
“name”: “When clicking ‘Test workflow’”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “c29b5813-4b10-485e-aa51-c873781fe416”,
“name”: “Batch_ID”,
“value”: 82,
“type”: “number”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
-1540,
460
],
“id”: “c17f570c-8c9b-4f56-ba7c-eb3e29023fc4”,
“name”: “Edit Fields”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “1976a082-3d1e-4065-8776-c87e7e7f2a3f”,
“name”: “debug_boolean_check”,
“value”: “={{ Array.isArray($json) && $json.length > 0 && !($json.length === 1 && JSON.stringify($json[0]) === "{}") }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
-1120,
460
],
“id”: “e5eb9c9b-b2a9-4344-a3d4-485ed7dad79b”,
“name”: “Edit Fields1”
}
],
“connections”: {
“Get Non-Adult-OK Content with AI High Confidence”: {
“main”: [
[
{
“node”: “Edit Fields1”,
“type”: “main”,
“index”: 0
}
]
]
},
“If1”: {
“main”: [
,
]
},
“When clicking ‘Test workflow’”: {
“main”: [
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “Get Non-Adult-OK Content with AI High Confidence”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields1”: {
“main”: [
[
{
“node”: “If1”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {}
}