# Filter data by another input

**URL:** <https://community.n8n.io/t/filter-data-by-another-input/34198>\
**Category:** Questions\
**Tags:** data-transformation\
**Created:** [December 14, 2023, 9:38am UTC](https://community.n8n.io/t/filter-data-by-another-input/34198 "2023-12-14T09:38:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shangzhw](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shangzhw](https://community.n8n.io/u/shangzhw)\
**Post date:** [December 14, 2023, 9:38am UTC](https://community.n8n.io/t/filter-data-by-another-input/34198/1 "2023-12-14T09:38:55Z")

</div>

There are two inputs, hoping to filter out some records in another input with a certain field in one input. I have tried Merge and Compare Datasets, but they don’t seem to work.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/a/7/a73e27ff81e554d778a59ccbcb06c9295b577428.png)  
 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/e/4/e41026a0d83156510613df730b8ccbbc086876c6.png)

```auto
## Information on your n8n setup
- **n8n version:1.16**
- **Database (default: SQLite):**
- **n8n EXECUTIONS_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):Docker**
- **Operating system:Windows 10**
```

---

<div class="post-metadata">

**Author:** ![ihortom](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ihortom/32/11473_2.png) [@ihortom](https://community.n8n.io/u/ihortom)\
**Post date:** [December 15, 2023, 12:27am UTC](https://community.n8n.io/t/filter-data-by-another-input/34198/2 "2023-12-15T00:27:08Z")

</div>

@shangzhw , could you be more specific what you are trying to achieve, and what is actual outcome of your setup?

The screenshot you provided is for the scenario where you want to find records in both datasets (Airtable and Node) with the same ID but output only the data from Notion when the match found. If that is what you need then it should work like that.

---

<div class="post-metadata">

**Author:** ![shangzhw](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shangzhw](https://community.n8n.io/u/shangzhw)\
**Post date:** [December 15, 2023, 12:57am UTC](https://community.n8n.io/t/filter-data-by-another-input/34198/3 "2023-12-15T00:57:31Z")

</div>

I’m sorry, the previous description was not complete. Your understanding is very accurate, this is what I want to achieve, but when I confirm that the two have data that can match, the output is still empty. I want to know if there is something wrong with the settings.

---

<div class="post-metadata">

**Author:** ![ihortom](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ihortom/32/11473_2.png) [@ihortom](https://community.n8n.io/u/ihortom)\
**Post date:** [December 15, 2023, 3:00am UTC](https://community.n8n.io/t/filter-data-by-another-input/34198/4 "2023-12-15T03:00:01Z")

</div>

@shangzhw , I believe your problem is because of IF node. It shouldn’t be there. Remove it from the equation and have Airtable connected in Input1 and Notion trigger to Input2 via Set node instead if IF. Let Set node add the ID composed of the two properties if the incoming data. Here’s an improvised example.

---

<div class="post-metadata">

**Author:** ![shangzhw](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shangzhw](https://community.n8n.io/u/shangzhw)\
**Post date:** [December 15, 2023, 3:28am UTC](https://community.n8n.io/t/filter-data-by-another-input/34198/5 "2023-12-15T03:28:32Z")

</div>

Removed the IF, deleted the remaining records in airtable, but the output is still empty.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/0/e/0e5b7637954cc766c6ce335266eeb57c4e33f679.png)  
 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/8/3/8336fff970ea84185f7b186af90b92ebf6d332a1.png)

---

<div class="post-metadata">

**Author:** ![shangzhw](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shangzhw](https://community.n8n.io/u/shangzhw)\
**Post date:** [December 15, 2023, 3:45am UTC](https://community.n8n.io/t/filter-data-by-another-input/34198/6 "2023-12-15T03:45:46Z")

</div>

Thank you, it worked! However, it was achieved by generating a new field in advance with the matching content, and using field names instead of expressions in the Merge. Can’t expressions be used in Merge? Or is this a BUG?

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/9/5/9501ae44424a0738179f882ce7f7b01a8c97b013.png)  
 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/0/6/06e6fe6575194e2598dc9e4026431ace58c80019.png)

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [December 15, 2023, 7:30am UTC](https://community.n8n.io/t/filter-data-by-another-input/34198/7 "2023-12-15T07:30:35Z")

</div>

The answer is right below the inputboxes. The name of the column is needed here for the merge to do its thing.  
So when using an expression you normally get a value of that field which is not helpful.

Of course if you have the name of the field to be merged in your input data you could use the expression, but that isn’t what you are doing here.

I expect that it would be beneficial to you to go through the 2 course n8n provides. 🙂

---

<div class="post-metadata">

**Author:** ![shangzhw](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@shangzhw](https://community.n8n.io/u/shangzhw)\
**Post date:** [December 15, 2023, 9:03am UTC](https://community.n8n.io/t/filter-data-by-another-input/34198/8 "2023-12-15T09:03:49Z")

</div>

Thank you very much

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [March 14, 2024, 9:04am UTC](https://community.n8n.io/t/filter-data-by-another-input/34198/9 "2024-03-14T09:04:46Z")

</div>

Closed on March 14, 2024, 9:04am UTC

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