Describe the problem/error/question
I’m trying to use else condition in set nodes (expressions) i’ve about 40 items, so the best way to achieve this is using the expression ineasted of ~40 copies of IF/SET nodes.
The issue is I tried to do this using Add else Condition in IF nodes Expression solution and using Add else Condition in IF nodes Expression - #4 by sirdavidoff. solution, both not working with my expressions:
Current expression: {{ $evaluateExpression($('Split').item.json[\"modifiedTags\"].join(', ')) ? $evaluateExpression($('Split').item.json[\"modifiedTags\"].join(', ')) : $('Parsing').item.json[\"HiddenData\"].match(/internal_product_tags:\\[\"(.*?)\\\"]/)[1] }}
What I want:
If this {{ $evaluateExpression($('Split').item.json["modifiedTags"].join(', ')) }}
undefined, then output this: {{ $('Parsing').item.json["HiddenData"].match(/internal_product_tags:\["(.*?)\"]/)[1] }}
And if both had value, then output the first one only.
What is the error message (if any)?
Getting undefined when there’s a value in the second expression in this case which is cross-sale:
Please share your workflow
Information on your n8n setup
- **n8n version: latest
- **Database (default: SQLite):default
- **n8n EXECUTIONS_PROCESS setting (default: own, main):default
- **Running n8n via (Docker, npm, n8n cloud, desktop app):Docker/hetzner
- **Operating system:ubuntu