# Referencing Network variable Value in a function node

**URL:** <https://discourse.nodered.org/t/referencing-network-variable-value-in-a-function-node/65441>\
**Category:** General\
**Tags:** function-node, mqtt\
**Created:** [21 July 2022 18:55 UTC](https://discourse.nodered.org/t/referencing-network-variable-value-in-a-function-node/65441 "2022-07-21T18:55:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RBSI](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@RBSI](https://discourse.nodered.org/u/RBSI)\
**Post date:** [21 July 2022 18:55 UTC](https://discourse.nodered.org/t/referencing-network-variable-value-in-a-function-node/65441/1 "2022-07-21T18:55:37Z")

</div>

![Network variable reference ask forum](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/5/8584d63465a2b27c97fe6db740b95b6c06236309.png)

Hello how can i reference a network variable value in the payload of a function node? Thanks

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [22 July 2022 03:05 UTC](https://discourse.nodered.org/t/referencing-network-variable-value-in-a-function-node/65441/2 "2022-07-22T03:05:50Z")

</div>

Sorry - can you put a debug node on the output of that WAGO PLC node and the Netvar receiver and then post a screen shot of the debug window so we can see what it is putting out

Craig

---

<div class="post-metadata">

**Author:** ![RBSI](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@RBSI](https://discourse.nodered.org/u/RBSI)\
**Post date:** [22 July 2022 17:30 UTC](https://discourse.nodered.org/t/referencing-network-variable-value-in-a-function-node/65441/4 "2022-07-22T17:30:26Z")

</div>

![Network variable debug output](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/e/8eb6558a31cb71bececa5bc8f8c325fddabcc798.png)

Sorry for being unclear,

Netvar-receiver just contains raw values of a UDP Network sender variables from a PLC programming software called e!cockpit.

Thanks

---

<div class="post-metadata">

**Author:** ![Hopperpop](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hopperpop/32/42533_2.png) [@Hopperpop](https://discourse.nodered.org/u/Hopperpop)\
**Post date:** [23 July 2022 07:22 UTC](https://discourse.nodered.org/t/referencing-network-variable-value-in-a-function-node/65441/5 "2022-07-23T07:22:06Z")

</div>

FYI netvar-receiver has a bug with negative Reals. Better is to use one of these nodes: [Node-red-contrib-nvl](https://flows.nodered.org/node/node-red-contrib-nvl) or [node-red-contrib-netvar-utils](https://flows.nodered.org/node/node-red-contrib-netvar-utils).

The first one is a node I created and is easier for referencing data as it's outputs everything as an object. No need for searching over the array to find the correct value, as you will need to do this with your current node.

---

<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:** [21 September 2022 07:22 UTC](https://discourse.nodered.org/t/referencing-network-variable-value-in-a-function-node/65441/6 "2022-09-21T07:22:13Z")

</div>

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