# Node if can't distinguish true and false when there is a lot of data, right?

**URL:** <https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509>\
**Category:** Questions\
**Tags:** if\
**Created:** [August 9, 2022, 11:31am UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509 "2022-08-09T11:31:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Panupol\_Sonnuam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/panupol_sonnuam/32/13703_2.png) [@Panupol\_Sonnuam](https://community.n8n.io/u/Panupol_Sonnuam)\
**Post date:** [August 9, 2022, 11:31am UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509/1 "2022-08-09T11:31:47Z")

</div>

There was a lot of information being sent.  
At the if node step extracts me the wrong information.  
make a lot of duplicate data  
or what should i do

 ![image](https://europe1.discourse-cdn.com/n8n/original/2X/f/f69dac96816473415cd8aec1525998b2da590ce1.png)

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [August 9, 2022, 11:52am UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509/2 "2022-08-09T11:52:37Z")

</div>

Hi @Panupol_Sonnuam, the amount of items shouldn’t affect the IF node’s ability to process them.

However, your conditions don’t seem to match your workflow data.

The first value in your _Check data old_ IF node is `{{$node["Update Find data old"].json["location"]}}` which returns only 70 items from looking at your screenshot. The IF node does, however, receive 72 items. So the missing items will cause problems here as the IF node will not have any data for them. You probably want to use an expression such as `{{ $json["location"] }}` instead to process all incoming items.

Next, value 2 of your IF node is `{{$node["Airtable Trigger"].json["fields"]["id booking"]}}`. It’s not clear to me how many items your Airtable Trigger returns, but if it’s anything else than 72 items in the exact order your IF node receives it’s also causing problems here and you probably need to use an expression such as `{{ $item(0).$node["Airtable Trigger"].json["fields"]["id booking"] }}` in order to always use the first item from your Airtable trigger node as the value 2 of your IF node. The $item(0) method is [explained here](https://docs.n8n.io/code-examples/javascript-functions/methods/#itemindex-number-runindex-number).

I hope this makes sense and helps!

---

<div class="post-metadata">

**Author:** ![Panupol\_Sonnuam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/panupol_sonnuam/32/13703_2.png) [@Panupol\_Sonnuam](https://community.n8n.io/u/Panupol_Sonnuam)\
**Post date:** [August 9, 2022, 12:52pm UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509/3 "2022-08-09T12:52:55Z")

</div>

The first value Should I put a command like this?

{{ $item(0).$json[“location”] }}

Because Update Find data old returns multiple values.

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [August 9, 2022, 12:54pm UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509/4 "2022-08-09T12:54:50Z")

</div>

I think in the first value you want to use simply `{{ $json["location"] }}` (assuming you want to compare the `location` field of every single incoming item).

---

<div class="post-metadata">

**Author:** ![Panupol\_Sonnuam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/panupol_sonnuam/32/13703_2.png) [@Panupol\_Sonnuam](https://community.n8n.io/u/Panupol_Sonnuam)\
**Post date:** [August 9, 2022, 12:58pm UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509/5 "2022-08-09T12:58:26Z")

</div>

I’ve tried and it doesn’t seem to work.  
Like the first value doesn’t change.  
causing the next one to go wrong

 ![image](https://europe1.discourse-cdn.com/n8n/original/2X/7/7e01c72d22f180c82b854ede64cb069022ec63ed.png)

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [August 9, 2022, 1:02pm UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509/6 "2022-08-09T13:02:00Z")

</div>

I am not sure I can follow. It seems to me like it’s working as expected, the booking id of your first item equals 3wu81dzav, subsequent ones don’t. So I would expect only one item to go to the true output.

---

<div class="post-metadata">

**Author:** ![Panupol\_Sonnuam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/panupol_sonnuam/32/13703_2.png) [@Panupol\_Sonnuam](https://community.n8n.io/u/Panupol_Sonnuam)\
**Post date:** [August 9, 2022, 1:11pm UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509/7 "2022-08-09T13:11:48Z")

</div>

I want to check another value too, is that possible?

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [August 9, 2022, 1:18pm UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509/8 "2022-08-09T13:18:30Z")

</div>

You mean checking multiple conditions? You can do so by clicking the _Add Condition_ on the IF node:

 ![image](https://europe1.discourse-cdn.com/n8n/original/2X/1/13cbd2cfb096c3589ab2ef1a6d215ef1e01c73d4.png)

Or do you want to do something like “does the id from my incoming item exist in the list of items coming from another node”? This would be something the Merge node can do in `Keep Key Matches` mode:

 ![image](https://europe1.discourse-cdn.com/n8n/original/2X/7/76466434137e7e852c15e77aae49b23688783921.png)

---

<div class="post-metadata">

**Author:** ![Panupol\_Sonnuam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/panupol_sonnuam/32/13703_2.png) [@Panupol\_Sonnuam](https://community.n8n.io/u/Panupol_Sonnuam)\
**Post date:** [August 9, 2022, 1:24pm UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509/9 "2022-08-09T13:24:33Z")

</div>

I want to check all all incoming data.  
The result in the picture should be all true because it will update the information that already exists.

But it seems that it can’t be checked because there are many items.  
Maybe need to use a loop item or something?

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [August 9, 2022, 3:15pm UTC](https://community.n8n.io/t/node-if-cant-distinguish-true-and-false-when-there-is-a-lot-of-data-right/16509/10 "2022-08-09T15:15:10Z")

</div>

Hi @Panupol_Sonnuam, this sounds like you’re looking for the Merge node comparing two different data sources with multiple items each (“return all items from list A with an ID that’s also in list B”).

Lorena wrote a comprehensive blog post on such a comparison recently which you can find here: [How to synchronize data between two systems – n8n Blog](https://blog.n8n.io/how-to-sync-data-between-two-systems/)
