Describe the problem/error/question
I’m trying to figure out if there is a way to create a rule in a switch node that matches on 2 values before sending to the output. I’m trying to match an email on the to address and contents of the subject. Matching on 1 rule is trivial but my brain can’t seem to work out creating an expression that would match on more than one thing… lol… My other thought was to get another node involved but that seems like an elegant solution.
What is the error message (if any)?
Please share your workflow
Switch v3
Routing Rules
Expression (get’s the “to” value from the email)
{{ $json.to.replaceAll(/<|>/gi, “”) }}
String is equal to
[email protected]
Output Name
some-output
(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: 1.45.1
- Database (default: SQLite): PostgreSQL
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Ubuntu 24