Merge with "contains key" logic

I need to extend Merge node’s “Keep key matches” mode to be a bit less strict and work in “Keep is contains key” mode.
What is the best approach?
Should I create/extend the existing Merge node? My original plan was to make Function node with logic i need, but i cant find how to create Function node with 2 inputs.

Any suggestions?

Hey @yavetal, you could use a Merge node to wait for both branches to finish and then a Function node to merge the data using your custom logic. For example like so:

This example uses the .includes() method to check whether one string is part of another string.

1 Like

Hi, thanks a ton for this sample! It’s a great idea to use merge just to wait for both inputs (I’ve missed that for some reason)!

However, I don’t really like this “indirect” data transfer, it kinda “shadowly” doubling the “real” data flow.
Visually, there are those connector lines, but “really” data is being transferred via “$items(“Mock data A”)”.

But i guess its fine, we’re working with a custom Function anyway :slight_smile: