Conditional Expression to Return First Available Value from Multiple Nodes

Is it possible to take the HashCode from the input that is available similar to this but this didn’t work.

{{
$(‘addLogMobino’).json.HashCode
|| $(‘addLogGsmplus’).json.HashCode
|| $(‘addLogMobileplus’).json.HashCode
|| ‘No HashCode found’
}}

returns this

Referenced node doesn’t exist

The node ‘addLogMobino’ doesn’t exist, but it’s used in an expression here.

Hi, @Gsmplus!

I suppose you have different branches and want to get and use the first available input from any of them. So, you can try to use Merge node with append mode first and then extract the first item either with a code node or set node. To be more clear, here’s an example.



Or using the Set node.

Hope that helps. Good luck!

3 Likes

Thanks Paul, that did the trick.