# Can we access data of left and right nodes of a link

**URL:** <https://discourse.nodered.org/t/can-we-access-data-of-left-and-right-nodes-of-a-link/81819>\
**Category:** Developing Nodes\
**Created:** [6 October 2023 06:34 UTC](https://discourse.nodered.org/t/can-we-access-data-of-left-and-right-nodes-of-a-link/81819 "2023-10-06T06:34:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zubong](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@zubong](https://discourse.nodered.org/u/zubong)\
**Post date:** [6 October 2023 06:34 UTC](https://discourse.nodered.org/t/can-we-access-data-of-left-and-right-nodes-of-a-link/81819/1 "2023-10-06T06:34:01Z")

</div>

```auto
RED.events.on("links:add", function(link) {
   ///link.left
  ///link.right
})

```

in the above code can I access data of left and right nodes of the link.!!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [6 October 2023 06:37 UTC](https://discourse.nodered.org/t/can-we-access-data-of-left-and-right-nodes-of-a-link/81819/2 "2023-10-06T06:37:45Z")

</div>

You can get downstream by looking in the `nodes` property of the `id` node in question.

If you really want upstream nodes, you would have to scan all nodes and check their `nodes` property for the existence of `id` of the node in question

However, can I ask why? A node should not care about upstream and downstream nodes.

---

<div class="post-metadata">

**Author:** ![zubong](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@zubong](https://discourse.nodered.org/u/zubong)\
**Post date:** [6 October 2023 06:43 UTC](https://discourse.nodered.org/t/can-we-access-data-of-left-and-right-nodes-of-a-link/81819/3 "2023-10-06T06:43:06Z")

</div>

> [@zubong](#):
>
> `link`

I was just wondering what properties we can access and operations we can perform using "link" object

---

<div class="post-metadata">

**Author:** ![zubong](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@zubong](https://discourse.nodered.org/u/zubong)\
**Post date:** [6 October 2023 06:46 UTC](https://discourse.nodered.org/t/can-we-access-data-of-left-and-right-nodes-of-a-link/81819/4 "2023-10-06T06:46:11Z")

</div>

there isn't much detail in documentation for "links:add" event so I just wanted to know what operations we can perform using link object.!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [5 December 2023 06:46 UTC](https://discourse.nodered.org/t/can-we-access-data-of-left-and-right-nodes-of-a-link/81819/5 "2023-12-05T06:46:59Z")

</div>

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