# How to access global variable in HTML file of custom node

**URL:** https://discourse.nodered.org/t/how-to-access-global-variable-in-html-file-of-custom-node/20248
**Category:** General
**Created:** [13 January 2020 07:07 UTC](https://discourse.nodered.org/t/how-to-access-global-variable-in-html-file-of-custom-node/20248 "2020-01-13T07:07:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kiran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kiran/32/27855_2.png) [@kiran](https://discourse.nodered.org/u/kiran)
#### Post date: [13 January 2020 07:07 UTC](https://discourse.nodered.org/t/how-to-access-global-variable-in-html-file-of-custom-node/20248/1 "2020-01-13T07:07:19Z")

</div>

first node (name connection)- \>\> in connection node - i accept device info like ip address and all details about device.

second node -( name request) -\>\> In request node i want to create drop down list of ip address which is registered in first node (connection).

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [13 January 2020 10:14 UTC](https://discourse.nodered.org/t/how-to-access-global-variable-in-html-file-of-custom-node/20248/2 "2020-01-13T10:14:40Z")

</div>

There are, I think, 3 ways to access data from another node:

1. The "Node-RED" way is to pass it from one to the other via a `node.send(msg)`. This is generally the best way.

2. You can access another node's .html js by calling a function in it directly

3. You can create an API function in the .js of the other node that you call from the .html of node.
