Merge node doesen't find source

Describe the problem/error/question

The merge-node doesnt work like it should.
I try to merge two threads to one with the combine methode.
The fields are diffrent named and I use the field expression because in input one I have to replace “.pdf” from the string. In input two I need two json.keys to build the matching value.

My second input is a if node.

In this screenshot is to see that the second input field has no value

But if I switch the Node input (leftside) to IF2 you can see that I have input and the inputfield 2 ({{ $json.AFJJ }}{{ $json.AFNR }}) find the value.

Now I don’t know why I get the error message that: You need to define both fields in “Fields to Match” for pair 1, field 1 = ‘2024633641’ field 2 = ‘’

Information on your n8n setup

  • n8n version:1.100.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker):
  • Operating system: linux

Hi,
I noticed that in the first image, the input data is in binary format, so the IF node won’t be able to process it the way you expect.
Therefore, you should add a Set node after the Read Metadata node to return a matchId value.

Hi @alexhuy,

read metadata has a binary item but I also have ja json item.

Here’s the fix:

Before the Merge node, add a Set node on each input and create a new field called merge_key.

In the first input (PDF filename):

js

CopyEdit

{{ $json.name.replace('.pdf', '') }}

In the second input (DB data):

js

CopyEdit

{{ $json.AFJJ }}{{ $json.AFNR }}

Then in the Merge node:

  • Set mode to Combine
  • Turn “Fields to Match Have Different Names” OFF
  • Use merge_key as the matching field for both Input 1 and Input 2

This way the Merge node doesn’t need to evaluate any expression—it just compares static values.

Ask ChatGPT

Thanks for the try to help me but now I get a new error if I use a set node.

IF Node doenst work if I use a Edit Field Node - Questions - n8n Community

The Set nodw ork now but the result is the same

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.