# $("\<node-name\>").item not working in IF node?

**URL:** <https://community.n8n.io/t/node-name-item-not-working-in-if-node/28820>\
**Category:** Questions\
**Tags:** if\
**Created:** [August 1, 2023, 9:30am UTC](https://community.n8n.io/t/node-name-item-not-working-in-if-node/28820 "2023-08-01T09:30:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GBOL](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gbol/32/35921_2.png) [@GBOL](https://community.n8n.io/u/GBOL)\
**Post date:** [August 1, 2023, 9:30am UTC](https://community.n8n.io/t/node-name-item-not-working-in-if-node/28820/1 "2023-08-01T09:30:58Z")

</div>

Hello there!

I’m almost sure this was working before.. I use to take the below argument from the first webhook node in a certain step of my workflow, and I had to convert the red line into the green line to make it working again.  
I also updated to the latest 1.x version just to check.

Is this a bug?

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/4/7/47f26913ee0e62c0f080611cc4f9c5216fc0e5dd.png)

---

<div class="post-metadata">

**Author:** ![GBOL](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gbol/32/35921_2.png) [@GBOL](https://community.n8n.io/u/GBOL)\
**Post date:** [August 1, 2023, 9:48am UTC](https://community.n8n.io/t/node-name-item-not-working-in-if-node/28820/3 "2023-08-01T09:48:55Z")

</div>

I just got another error after testing the new expression:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/a/0/a012208ac4b88017ff1b9abec2aaba0e85016512.png)

---

<div class="post-metadata">

**Author:** ![EmeraldHerald](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/emeraldherald/32/35355_2.png) [@EmeraldHerald](https://community.n8n.io/u/EmeraldHerald)\
**Post date:** [August 1, 2023, 10:49am UTC](https://community.n8n.io/t/node-name-item-not-working-in-if-node/28820/4 "2023-08-01T10:49:43Z")

</div>

Hi @GBOL 👋 Sorry you’re running into this!

Edit: Just had a peek into some issues other users have been running into.

`$('Node name').item` and `$node["Node name"]` do different things, so this might be what’s causing some confusion 🙈 The legacy expression `$node["node name"]` would reference items from a previous node by item index, whereas `$('node name').item` makes uses of [item linking (previously called item pairing)](https://docs.n8n.io/data/data-mapping/data-item-linking/item-linking-concepts/). Item pairing is not new functionality related to v1, item pairing was first introduced with n8n 0.180 around a year ago.

v1 also now throws this error to make you aware of a problem that was previously present in your expression, as it’s expecting a different data structure. My teammate @MutedJam explained this in another thread here:

> [@1.0.5 - docker n8nio:latest ERROR: No data found for item-index: "1" - There's no item index?](http://community.n8n.io/t/1-0-5-docker-n8nio-latest-error-no-data-found-for-item-index-1-theres-no-item-index/28525/7):
>
> This expression preview would be shown for the first of your input items (with index 0), for which the expression would still work. It’s only failing for the second item (with item index 1) because your SSH Test connectivity node only produces a single item. The expression itself still works, it just isn’t suitable for your specific data structure as I’ve tried to explain earlier. v1 throws an error now making you aware of this problem, whereas previous versions would seem to simply return an …

Can you try out the expression `{{ $('webhook').first().json.body.is_test }}` and see if that works? If not, can you please share a workflow that doesn’t require any outside credentials / has sample data that we can look into?

---

<div class="post-metadata">

**Author:** ![GBOL](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gbol/32/35921_2.png) [@GBOL](https://community.n8n.io/u/GBOL)\
**Post date:** [August 1, 2023, 1:54pm UTC](https://community.n8n.io/t/node-name-item-not-working-in-if-node/28820/5 "2023-08-01T13:54:38Z")

</div>

Thanks @EmeraldHerald !  
Your suggested expression have worked!  
Is there any updated documentation on the supported expressions?  
Thanks

---

<div class="post-metadata">

**Author:** ![EmeraldHerald](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/emeraldherald/32/35355_2.png) [@EmeraldHerald](https://community.n8n.io/u/EmeraldHerald)\
**Post date:** [August 1, 2023, 2:09pm UTC](https://community.n8n.io/t/node-name-item-not-working-in-if-node/28820/6 "2023-08-01T14:09:52Z")

</div>

Glad to hear it worked!

I know there’s some updates coming to the expressions documentation, but I wouldn’t have an estimate as to when that change will be 🙈

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/36532_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [August 8, 2023, 2:10pm UTC](https://community.n8n.io/t/node-name-item-not-working-in-if-node/28820/7 "2023-08-08T14:10:24Z")

</div>

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