I need to see if a specific domain exist in some email addresses in an array. If it does, it should be true ouput.
It seems like the “If” node only matches on exact word?
If my assumption is right, any good workaround?
Information on your n8n setup
n8n version:
1.25.1
As always, thanks for great and quick support on questions!
As a bonus,
An easy way to split thisdomain arrays elements into a new array thisdomain and the other ones into array thatdomain that would be great. Easy doable?
From there depending on the end goal there are a couple of options although you could also take the first email array and split it out into items then use an if or switch node to route the emails to a different part of the workflow.
Yup it looks like contains expects an exact match so you would need to get more creative, You could use a Bool and if Value is true then select an expression and input {{ $json.emails.some(e => /@thisdomain.com/g.test(e)) }} which would return true once something matches the pattern. It won’t split out the items though.