# Global Variable Values to a file or E-mail

**URL:** https://discourse.nodered.org/t/global-variable-values-to-a-file-or-e-mail/97326
**Category:** General
**Created:** [29 May 2025 17:59 UTC](https://discourse.nodered.org/t/global-variable-values-to-a-file-or-e-mail/97326 "2025-05-29T17:59:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)
#### Post date: [29 May 2025 17:59 UTC](https://discourse.nodered.org/t/global-variable-values-to-a-file-or-e-mail/97326/1 "2025-05-29T17:59:22Z")

</div>

Hi,  
I have now worked out how to get my sensor data stored in global variables with the change node, so how do I get all the values into a file or an email ?

Thanks  
Stuart

---

<div class="post-metadata">

### Author: ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)
#### Post date: [30 May 2025 06:13 UTC](https://discourse.nodered.org/t/global-variable-values-to-a-file-or-e-mail/97326/2 "2025-05-30T06:13:16Z")

</div>

By using the "write file" and "email" nodes. Read the help for each to get you started.

---

<div class="post-metadata">

### Author: ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)
#### Post date: [30 May 2025 14:39 UTC](https://discourse.nodered.org/t/global-variable-values-to-a-file-or-e-mail/97326/3 "2025-05-30T14:39:57Z")

</div>

Unfortunately the help files "write File" and "email" don't really help me as there is no mention of using system variables within your text.

Thanks  
Stuart

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [30 May 2025 14:59 UTC](https://discourse.nodered.org/t/global-variable-values-to-a-file-or-e-mail/97326/4 "2025-05-30T14:59:33Z")

</div>

Do you know how to get data from your variable into a message? As msg.payload for example?

What happens when you send msg.payload into a Write-file node?  
Is it the same for the email node, or does the node help tell you how to get a message property into the email body?

---

<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: [30 May 2025 15:11 UTC](https://discourse.nodered.org/t/global-variable-values-to-a-file-or-e-mail/97326/5 "2025-05-30T15:11:42Z")

</div>

I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<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: [28 August 2025 15:12 UTC](https://discourse.nodered.org/t/global-variable-values-to-a-file-or-e-mail/97326/6 "2025-08-28T15:12:33Z")

</div>

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