# Load email address from dashboard

**URL:** <https://discourse.nodered.org/t/load-email-address-from-dashboard/1511>\
**Category:** Dashboard\
**Created:** [11 July 2018 12:51 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511 "2018-07-11T12:51:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [11 July 2018 12:51 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/1 "2018-07-11T12:51:11Z")

</div>

Hi All  
I'm trying to load an email address from dashboard to my email node  
When I try trigger the email, the trigger replaces the email address causing an error  
Any suggestions would be appreciated.  
Regards  
Barry

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [11 July 2018 17:43 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/2 "2018-07-11T17:43:42Z")

</div>

Want to provide a _small_ sample flow demonstrating the issue?

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [12 July 2018 15:19 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/3 "2018-07-12T15:19:21Z")

</div>

`[{"id":"a05fc519.e36ad8","type":"inject","z":"716e078a.2ee618","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":220,"wires":[["6254b2a6.e92fec","74adbc63.ec9b34"]]},{"id":"6254b2a6.e92fec","type":"ui_text_input","z":"716e078a.2ee618","name":"","label":"Email","group":"9ab3fb8d.b50348","order":0,"width":0,"height":0,"passthru":false,"mode":"email","delay":300,"topic":"","x":270,"y":200,"wires":[["368e8207.edbe3e"]]},{"id":"74adbc63.ec9b34","type":"file in","z":"716e078a.2ee618","name":"Batch Reports","filename":"/home/pi/node-red/Batch Requested Temp.csv","format":"","chunk":false,"sendError":false,"x":260,"y":260,"wires":[["93b7bbcf.f7dcc8"]]},{"id":"368e8207.edbe3e","type":"change","z":"716e078a.2ee618","name":"","rules":[{"t":"set","p":"to","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":200,"wires":[["a08040a9.9206a","6d603ab0.de65a4"]]},{"id":"93b7bbcf.f7dcc8","type":"change","z":"716e078a.2ee618","name":"","rules":[{"t":"set","p":"attachments","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":260,"wires":[["a08040a9.9206a"]]},{"id":"a08040a9.9206a","type":"e-mail","z":"716e078a.2ee618","server":"smtp.gmail.com","port":"465","secure":true,"name":"","dname":"UI Email","x":680,"y":200,"wires":[]},{"id":"6d603ab0.de65a4","type":"debug","z":"716e078a.2ee618","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":120,"wires":[]},{"id":"9ab3fb8d.b50348","type":"ui_group","z":"","name":"Default","tab":"3cf93c06.c8b134","disp":true,"width":"6","collapse":false},{"id":"3cf93c06.c8b134","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]`

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2018 15:33 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/4 "2018-07-12T15:33:53Z")

</div>

Ok, first off the ui-text will send the payload as each letter is typed, so if you were typing in [barry@mydomain.com](mailto:barry@mydomain.com), then you would get  
b  
ba  
bar  
barr  
barry  
barry@  
... till  
[barry@mydomain.com](mailto:barry@mydomain.com)  
and it would try to send it for each payload.

Try using the ui-form and pick the type `E-mail`

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [12 July 2018 15:53 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/5 "2018-07-12T15:53:58Z")

</div>

Hi & thank you

`[{"id":"a05fc519.e36ad8","type":"inject","z":"716e078a.2ee618","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":200,"wires":[["74adbc63.ec9b34","368e8207.edbe3e"]]},{"id":"74adbc63.ec9b34","type":"file in","z":"716e078a.2ee618","name":"Batch Reports","filename":"/home/pi/node-red/Batch Requested Temp.csv","format":"","chunk":false,"sendError":false,"x":280,"y":260,"wires":[["93b7bbcf.f7dcc8"]]},{"id":"368e8207.edbe3e","type":"change","z":"716e078a.2ee618","name":"","rules":[{"t":"set","p":"to","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":200,"wires":[["a08040a9.9206a","6d603ab0.de65a4"]]},{"id":"93b7bbcf.f7dcc8","type":"change","z":"716e078a.2ee618","name":"","rules":[{"t":"set","p":"attachments","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":260,"wires":[["a08040a9.9206a"]]},{"id":"a08040a9.9206a","type":"e-mail","z":"716e078a.2ee618","server":"smtp.gmail.com","port":"465","secure":true,"name":"","dname":"UI Email","x":680,"y":200,"wires":[]},{"id":"6d603ab0.de65a4","type":"debug","z":"716e078a.2ee618","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":120,"wires":[]},{"id":"998ca6b.a666c58","type":"ui_form","z":"716e078a.2ee618","name":"","label":"","group":"9ab3fb8d.b50348","order":0,"width":0,"height":0,"options":[{"label":"","value":"E-mail","type":"email","required":true}],"formValue":{"E-mail":""},"payload":"","topic":"","x":260,"y":120,"wires":[["368e8207.edbe3e"]]},{"id":"9ab3fb8d.b50348","type":"ui_group","z":"","name":"Default","tab":"3cf93c06.c8b134","disp":true,"width":"6","collapse":false},{"id":"3cf93c06.c8b134","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]`

But it still wont trigger.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2018 16:32 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/6 "2018-07-12T16:32:02Z")

</div>

stick a debug node to the output of the form (complete msg object) and see what comes out.

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [12 July 2018 16:39 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/7 "2018-07-12T16:39:56Z")

</div>

7‎/‎12‎/‎2018‎ ‎11‎:‎38‎:‎35‎ ‎AMnode: 462ac887.5d0c48

msg : Object

object

payload: object

E-mail: "barry@mydomane.com"

topic: ""

socketid: "uSxIPahPpABpYhzeAAAB"

\_msgid: "43d99ba8.073404"

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2018 16:45 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/8 "2018-07-12T16:45:05Z")

</div>

ok, so the email address is in msg.payload.E-mail... What is your change node doing?

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [12 July 2018 16:46 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/9 "2018-07-12T16:46:29Z")

</div>

the purpose of the change node is to change the payload to msg.to for the email node

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2018 16:48 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/10 "2018-07-12T16:48:56Z")

</div>

You need to `move` the piece of the msg that contains the email address to msg.to

So what now contains the email address?

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [12 July 2018 16:58 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/11 "2018-07-12T16:58:12Z")

</div>

is `move` a node or a function of the change node ?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2018 17:02 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/12 "2018-07-12T17:02:55Z")

</div>

`move` moves a chunk of data from one place to another  
`set` copies a chunk of data from one place to another

use which ever fits the issue you are dealing with

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [12 July 2018 17:22 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/13 "2018-07-12T17:22:17Z")

</div>

`[{"id":"a05fc519.e36ad8","type":"inject","z":"716e078a.2ee618","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":200,"wires":[["74adbc63.ec9b34"]]},{"id":"74adbc63.ec9b34","type":"file in","z":"716e078a.2ee618","name":"Batch Reports","filename":"/home/pi/node-red/Batch Requested Temp.csv","format":"","chunk":false,"sendError":false,"x":280,"y":260,"wires":[["93b7bbcf.f7dcc8"]]},{"id":"93b7bbcf.f7dcc8","type":"change","z":"716e078a.2ee618","name":"","rules":[{"t":"set","p":"attachments","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":260,"wires":[["a08040a9.9206a"]]},{"id":"a08040a9.9206a","type":"e-mail","z":"716e078a.2ee618","server":"smtp.gmail.com","port":"465","secure":true,"name":"","dname":"UI Email","x":680,"y":200,"wires":[]},{"id":"368e8207.edbe3e","type":"change","z":"716e078a.2ee618","name":"","rules":[{"t":"move","p":"to","pt":"msg","to":"msg.to","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":200,"wires":[["a08040a9.9206a","6d603ab0.de65a4"]]},{"id":"6d603ab0.de65a4","type":"debug","z":"716e078a.2ee618","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":120,"wires":[]},{"id":"998ca6b.a666c58","type":"ui_form","z":"716e078a.2ee618","name":"","label":"","group":"9ab3fb8d.b50348","order":0,"width":0,"height":0,"options":[{"label":"Contact 1","value":"msg.to","type":"email","required":true}],"formValue":{"msg.to":""},"payload":"","topic":"","x":260,"y":120,"wires":[["462ac887.5d0c48","368e8207.edbe3e"]]},{"id":"462ac887.5d0c48","type":"debug","z":"716e078a.2ee618","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":600,"y":40,"wires":[]},{"id":"9ab3fb8d.b50348","type":"ui_group","z":"","name":"Default","tab":"3cf93c06.c8b134","disp":true,"width":"6","collapse":false},{"id":"3cf93c06.c8b134","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]]`

I can't see what i'm doing wrong

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2018 17:34 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/14 "2018-07-12T17:34:34Z")

</div>

your change node says:  
Move: `msg.to`  
to : `msg.msg.to`  
which says move what ever is in msg.to to the field msg.msg.to.

1. where did you come up with `msg.msg.to`
2. look at the email node - what field do you need to pass to it?
3. go back and look at the debug node output from the ui-form node - what field contains the email address?

So, now that you have that information, how should you setup your change node?

(I gave you the answer to part of this several posts ago)

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [12 July 2018 19:10 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/15 "2018-07-12T19:10:06Z")

</div>

Thank You Paul 🕶🕶🕶

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 July 2018 19:28 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/16 "2018-07-12T19:28:07Z")

</div>

I'm glad I could point you in the direction so you could figure it out yourself. 😀

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [13 July 2018 15:10 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/17 "2018-07-13T15:10:31Z")

</div>

I can load the email address into the email node  
and it sends an e-mail

But when I trigger the email from a different source , the address is gone and I get a

> "Error: No recipients defined"  
> Is it possible to have the address remain as default

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 July 2018 15:18 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/18 "2018-07-13T15:18:40Z")

</div>

can you be more specific about a 'different source'? Maybe attach the flow?

---

<div class="post-metadata">

**Author:** ![barry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/barry/32/1022_2.png) [@barry](https://discourse.nodered.org/u/barry)\
**Post date:** [13 July 2018 15:20 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/19 "2018-07-13T15:20:04Z")

</div>

`[{"id":"95f0485e.98aa58","type":"inject","z":"716e078a.2ee618","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":140,"wires":[["739d84ba.594f7c"]]},{"id":"739d84ba.594f7c","type":"file in","z":"716e078a.2ee618","name":"Batch Reports","filename":"/home/pi/node-red/Batch Requested Temp.csv","format":"","chunk":false,"sendError":false,"x":480,"y":140,"wires":[["9278b0f0.474f1"]]},{"id":"9278b0f0.474f1","type":"e-mail","z":"716e078a.2ee618","server":"smtp.gmail.com","port":"465","secure":true,"name":"","dname":"","x":750,"y":140,"wires":[]},{"id":"7ec48af5.b81ff4","type":"change","z":"716e078a.2ee618","name":"","rules":[{"t":"set","p":"to","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":40,"wires":[["bc9ed8ca.efae88","9278b0f0.474f1"]]},{"id":"29a21c74.681074","type":"inject","z":"716e078a.2ee618","name":"","topic":"email","payload":"barry.miller@live.com","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":40,"wires":[["7ec48af5.b81ff4"]]},{"id":"bc9ed8ca.efae88","type":"debug","z":"716e078a.2ee618","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":750,"y":40,"wires":[]}]`

---

<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:** [13 July 2018 15:37 UTC](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511/20 "2018-07-13T15:37:05Z")

</div>

> [@barry](#):
>
> But when I trigger the email from a different source , the address is gone

The email node does not remember the address etc from the previous email, each message you send has to have that data, so you need to set it in the message being passed from the File node. You can insert a Change node to do that.

[Next page](https://discourse.nodered.org/t/load-email-address-from-dashboard/1511.md?page=2)
