Hi there, I’m running into an issue to use Regex Match in an IF node using a regex stored in a previous node. Can somebody spot my mistake or help me find a workaround ?
Hi @alxnzx, based on your screenshot it’s unfortunately hard to say what exactly is happening. Perhaps you can share an example workflow including some dummy data using which your problem can be reproduced?
My first guess is that your sourceSwitch node returns a different number of items than your versionFilter node receives. So you might need to use an expression like {{ $("sourceSwitch").first().json.yourRegexField }} to always use the first field from your sourceSwitch node for the comparison, similar to what I described over here.
Hi @MutedJam and thank you for your answer. I have tried but it doesn’t seem to work. My sourceSwitch only sends one item as shown in the screenshot here.
Solved it. Had to use $('sourceSwitch').itemMatching(0).json.versionRegex. For some reason (the fact that it’s a switch node?) the $('sourceSwitch').first().json.versionRegex did not return any result.