Describe the problem/error/question
I am trying to build a switch that triggers different emails for a drip sequence. i have used a filter node to get the data and then added edit fields to change data for the switch options but i am not getting it to work properly. everything is running to the same condition in the switch. how do i transform the data field temporarily to guide the switch conditions? i will permanently transform the data after a send.
tia!
What is the error message (if any)?
Please share your workflow
{
“nodes”: [
{
“parameters”: {
“rule”: {
“interval”: [
{
“triggerAtHour”: 9
}
]
}
},
“type”: “n8n-nodes-base.scheduleTrigger”,
“typeVersion”: 1.2,
“position”: [
-384,
-16
],
“id”: “06b7bb9b-c36d-41c2-a1d1-20e184faa2ab”,
“name”: “Schedule Trigger”
},
{
“parameters”: {
“documentId”: {
“__rl”: true,
“value”: “1CUMpcmr19u32mqLxJu3ju5pzr8DTTaZD17nYbBejzf0”,
“mode”: “list”,
“cachedResultName”: “Payroc Lead List”,
“cachedResultUrl”: “https://docs.google.com/spreadsheets/d/1CUMpcmr19u32mqLxJu3ju5pzr8DTTaZD17nYbBejzf0/edit?usp=drivesdk”
},
“sheetName”: {
“__rl”: true,
“value”: “gid=0”,
“mode”: “list”,
“cachedResultName”: “Sheet1”,
“cachedResultUrl”: “https://docs.google.com/spreadsheets/d/1CUMpcmr19u32mqLxJu3ju5pzr8DTTaZD17nYbBejzf0/edit#gid=0”
},
“options”: {}
},
“type”: “n8n-nodes-base.googleSheets”,
“typeVersion”: 4.7,
“position”: [
-176,
-16
],
“id”: “8168a603-292a-4823-a105-e858db2d3266”,
“name”: “Get row(s) in sheet”,
“credentials”: {
“googleSheetsOAuth2Api”: {
“id”: “5LQAhGD5BiJt3lOC”,
“name”: “Google Sheets account 2”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “loose”,
“version”: 2
},
“conditions”: [
{
“id”: “1f4663fd-ba06-4793-998d-634fb2baaec0”,
“leftValue”: “={{ $json[‘Message Number’] }}”,
“rightValue”: 5,
“operator”: {
“type”: “number”,
“operation”: “lt”
}
},
{
“id”: “f25f87c0-e006-4430-bb2d-c1c95f7ac8a5”,
“leftValue”: “={{ Date.parse($json[‘Last Sent’]) }}”,
“rightValue”: “={{ Date.parse($json[‘Last Sent’]) - 259200000 }}”,
“operator”: {
“type”: “number”,
“operation”: “gt”
}
},
{
“id”: “478171eb-ab55-47eb-8d2e-3b9135786c7e”,
“leftValue”: “={{ Date.parse($json[‘Last Sent’]) }}”,
“rightValue”: “={{ Date.parse($json[‘Last Sent’]) - 518400000 }}”,
“operator”: {
“type”: “number”,
“operation”: “gt”
}
}
],
“combinator”: “and”
},
“looseTypeValidation”: true,
“options”: {}
},
“type”: “n8n-nodes-base.filter”,
“typeVersion”: 2.2,
“position”: [
32,
-16
],
“id”: “510c7775-84cc-4e64-ae61-d0677b8ead0d”,
“name”: “Filter”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “cf18afc3-738b-4222-9fdf-fbfce713b323”,
“name”: “Next Email”,
“value”: “={{ Number($json["Message_Number"] || 1) + 1 }}”,
“type”: “string”
},
{
“id”: “e35ca7fa-52d8-4ee5-95a5-f44830cce000”,
“name”: “Next Email”,
“value”: “={{ Number($json["Message_Number"] || 0) + 1 }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
240,
-16
],
“id”: “05c7516e-6285-4556-b207-b6cbae75af4c”,
“name”: “Edit Fields”
},
{
“parameters”: {
“rules”: {
“values”: [
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “c892b06c-ccca-498c-82ff-19aaf1d64307”,
“leftValue”: “={{ $json[‘Next Email’] }}”,
“rightValue”: “1”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
}
},
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “66829cb5-af5e-47ec-b8f7-cc809ae790dd”,
“leftValue”: “={{ $json[‘Next Email’] }}”,
“rightValue”: “2”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
}
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.switch”,
“typeVersion”: 3.3,
“position”: [
448,
-16
],
“id”: “66823dcb-d918-47a0-be33-eac084bee0e2”,
“name”: “Switch”
}
],
“connections”: {
“Schedule Trigger”: {
“main”: [
[
{
“node”: “Get row(s) in sheet”,
“type”: “main”,
“index”: 0
}
]
]
},
“Get row(s) in sheet”: {
“main”: [
[
{
“node”: “Filter”,
“type”: “main”,
“index”: 0
}
]
]
},
“Filter”: {
“main”: [
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “Switch”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “939f987c97668a01954a7e6c13eb949567081e72165a04e7117302dcf0e9a8a1”
}
}
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system: