# Detect link in nodes with a function node

**URL:** <https://discourse.nodered.org/t/detect-link-in-nodes-with-a-function-node/70406>\
**Category:** General\
**Created:** [10 November 2022 14:27 UTC](https://discourse.nodered.org/t/detect-link-in-nodes-with-a-function-node/70406 "2022-11-10T14:27:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NetHans](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nethans/32/2843_2.png) [@NetHans](https://discourse.nodered.org/u/NetHans)\
**Post date:** [10 November 2022 14:27 UTC](https://discourse.nodered.org/t/detect-link-in-nodes-with-a-function-node/70406/1 "2022-11-10T14:27:57Z")

</div>

Hello,

I want to find out all "link in" nodes in a function node.  
Unfortunately, the function `RED.nodes.filterNodes({ type: "link in" })` is not available in the function node. Is there any other way to identify the link in nodes?

I have defined numerous test cases in Node-RED, which are started individually via a "link in" node.

Now I would like to create a summary test, which dynamically detects all test cases and processes them sequentially.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [12 November 2022 16:16 UTC](https://discourse.nodered.org/t/detect-link-in-nodes-with-a-function-node/70406/2 "2022-11-12T16:16:30Z")

</div>

This flow will identify the `link in` nodes and output a sequence of messages, one per instance.

```auto
[{"id":"e07445aa.50d4e","type":"inject","z":"2f7c2f6d.c20a68","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":460,"wires":[["7d30d17a.7a26"]]},{"id":"7d30d17a.7a26","type":"http request","z":"2f7c2f6d.c20a68","name":"GET flows","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://localhost:1880/flows","tls":"","persist":false,"proxy":"","authType":"","x":370,"y":460,"wires":[["8cb7dc90.4a0728"]],"info":"Get list (array) of all tabs and nodes.\n"},{"id":"8cb7dc90.4a0728","type":"split","z":"2f7c2f6d.c20a68","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":510,"y":460,"wires":[["6d96df9b.613578"]]},{"id":"6d96df9b.613578","type":"switch","z":"2f7c2f6d.c20a68","name":"type","property":"payload.type","propertyType":"msg","rules":[{"t":"eq","v":"link in","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":460,"wires":[["57e0b751.0cac4"]]},{"id":"57e0b751.0cac4","type":"debug","z":"2f7c2f6d.c20a68","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":770,"y":460,"wires":[]}]

```

Not as neat as having it all in a `function` node, but it might serve.

---

<div class="post-metadata">

**Author:** ![NetHans](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nethans/32/2843_2.png) [@NetHans](https://discourse.nodered.org/u/NetHans)\
**Post date:** [12 November 2022 21:45 UTC](https://discourse.nodered.org/t/detect-link-in-nodes-with-a-function-node/70406/3 "2022-11-12T21:45:57Z")

</div>

> [@drmibell](#):
>
> Not as neat as having it all in a `function` node, but it might serve.

Thank you for your example flow. It is not an ideal solution, but I can live with it very well 😉 Thank you very much.

Maybe the `link call` node will be extended in the future, so that the `link in` nodes can be detected to make the dynamic link even more dynamic 😉

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [13 November 2022 00:49 UTC](https://discourse.nodered.org/t/detect-link-in-nodes-with-a-function-node/70406/4 "2022-11-13T00:49:35Z")

</div>

You're welcome.

> [@NetHans](#):
>
> so that the `link in` nodes can be detected

Not exactly sure what you mean here. If you want the target of the `link call` to know which node "called" it, you can add a property (for example, msg.source) to the message being passed.

---

<div class="post-metadata">

**Author:** ![NetHans](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nethans/32/2843_2.png) [@NetHans](https://discourse.nodered.org/u/NetHans)\
**Post date:** [16 November 2022 20:38 UTC](https://discourse.nodered.org/t/detect-link-in-nodes-with-a-function-node/70406/5 "2022-11-16T20:38:12Z")

</div>

> [@drmibell](#):
>
> Not exactly sure what you mean here. If you want the target of the `link call` to know which node "called" it, you can add a property (for example, msg.source) to the message being passed.

I wanted to suggest that the node is supplemented to list all link in nodes. In itself the same as your example flow only without API access.

---

<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:** [30 November 2022 20:38 UTC](https://discourse.nodered.org/t/detect-link-in-nodes-with-a-function-node/70406/6 "2022-11-30T20:38:45Z")

</div>

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