# How can i use the value of a variable i created inside the template node

**URL:** https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780
**Category:** Dashboard
**Tags:** node-red-dashboard
**Created:** [6 December 2021 14:51 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780 "2021-12-06T14:51:13Z")
**Posts on this page:** 14
**Page:** 2

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 December 2021 16:30 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/22 "2021-12-06T16:30:25Z")

</div>

OK, that does make it tricky. How are you going to read the files if they are not on the same machine that is running node-red?

---

<div class="post-metadata">

### Author: ![hanine](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hanine](https://discourse.nodered.org/u/hanine)
#### Post date: [6 December 2021 16:35 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/23 "2021-12-06T16:35:25Z")

</div>

no they are on the same machine it's just that they are of big sizes which seems to be a problem for node red to pass between nodes

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 December 2021 16:44 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/24 "2021-12-06T16:44:13Z")

</div>

So the files are accessible to the node-red server. I still don't understand exactly what you are trying to do on the dashboard. If it is just a matter of selecting files from a list, can't you use a dashboard dropdown node?

---

<div class="post-metadata">

### Author: ![hanine](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hanine](https://discourse.nodered.org/u/hanine)
#### Post date: [6 December 2021 16:48 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/25 "2021-12-06T16:48:39Z")

</div>

its not a list it's an input like this

---

<div class="post-metadata">

### Author: ![hanine](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hanine](https://discourse.nodered.org/u/hanine)
#### Post date: [6 December 2021 16:48 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/26 "2021-12-06T16:48:49Z")

</div>

```auto
 <input type="file" id="myFile" webkitdirectory directory multiple onchange="uploadfile()">

```

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 December 2021 16:52 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/27 "2021-12-06T16:52:54Z")

</div>

Why don't you just read the file in node red rather than upload it?

---

<div class="post-metadata">

### Author: ![hanine](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hanine](https://discourse.nodered.org/u/hanine)
#### Post date: [6 December 2021 16:54 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/28 "2021-12-06T16:54:30Z")

</div>

can you explain more please i didn't understand

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 December 2021 16:57 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/29 "2021-12-06T16:57:58Z")

</div>

You said the files are on the same machine that is running node-red. In that case you can use a File In node to read the file directly from disc.

---

<div class="post-metadata">

### Author: ![hanine](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hanine](https://discourse.nodered.org/u/hanine)
#### Post date: [6 December 2021 17:01 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/30 "2021-12-06T17:01:56Z")

</div>

they can be chosen dynamically it's not a one static file it changes and you can also choose multiple files and you can choose different files each time that's the problem and the size of the files are big so that's what's causing the problem. I can pass them through node i figured how from the documentation you provided to me but its causing a problem because of the file size

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 December 2021 17:03 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/31 "2021-12-06T17:03:54Z")

</div>

Do you mean that you cannot use a File In node because they are too big?

How big are they?

---

<div class="post-metadata">

### Author: ![hanine](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hanine](https://discourse.nodered.org/u/hanine)
#### Post date: [6 December 2021 17:05 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/32 "2021-12-06T17:05:52Z")

</div>

yes i can't pass the encoding because they are big its more then 1,430 KB

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 December 2021 17:08 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/33 "2021-12-06T17:08:09Z")

</div>

That is not a large file, I thought you were going to say they are multiple GB.  
The right way to do this is with a File node. I suggest you start a new thread describing what problem you are having.

---

<div class="post-metadata">

### Author: ![hanine](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@hanine](https://discourse.nodered.org/u/hanine)
#### Post date: [7 December 2021 10:31 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/34 "2021-12-07T10:31:53Z")

</div>

Thank you I am trying to fix it with a file 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: [6 January 2022 10:32 UTC](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780/35 "2022-01-06T10:32:22Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/how-can-i-use-the-value-of-a-variable-i-created-inside-the-template-node/54780.md?page=1)
