# Output two attributes in the template

**URL:** <https://discourse.nodered.org/t/output-two-attributes-in-the-template/5983>\
**Category:** Dashboard\
**Created:** [20 December 2018 12:58 UTC](https://discourse.nodered.org/t/output-two-attributes-in-the-template/5983 "2018-12-20T12:58:05Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [20 December 2018 14:05 UTC](https://discourse.nodered.org/t/output-two-attributes-in-the-template/5983/6 "2018-12-20T14:05:36Z")

</div>

Which is why I also suggested you look at how to store data.

It sounds as if you want both values to be stored. So that when new message comes in  
for door it picks up the latest value of help  
and if a new help message comes in it picks up the latest version of door.

See

```auto
[{"id":"bc95c600.8a7ff","type":"inject","z":"44c6969d.6be6c","name":"","topic":"","payload":"Door1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":125.5,"y":121,"wires":[["e74f067f.68d2e8"]]},{"id":"40776dfa.949a94","type":"inject","z":"44c6969d.6be6c","name":"","topic":"","payload":"Help1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":136,"y":260,"wires":[["527b8184.c9bcc8"]]},{"id":"c04f22bc.ece308","type":"inject","z":"44c6969d.6be6c","name":"","topic":"","payload":"Door2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":126,"y":160,"wires":[["e74f067f.68d2e8"]]},{"id":"2a297a3f.5793fe","type":"inject","z":"44c6969d.6be6c","name":"","topic":"","payload":"Help2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":135,"y":301,"wires":[["527b8184.c9bcc8"]]},{"id":"e74f067f.68d2e8","type":"change","z":"44c6969d.6be6c","name":"","rules":[{"t":"set","p":"door","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":272.5,"y":141,"wires":[["6eed31e.adb2c5"]]},{"id":"527b8184.c9bcc8","type":"change","z":"44c6969d.6be6c","name":"","rules":[{"t":"set","p":"help","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":279,"y":278,"wires":[["20dcad07.a5a60a"]]},{"id":"6eed31e.adb2c5","type":"change","z":"44c6969d.6be6c","name":"","rules":[{"t":"set","p":"door","pt":"global","to":"door","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":499.5,"y":140,"wires":[["3d0d745f.6cadcc"]]},{"id":"20dcad07.a5a60a","type":"change","z":"44c6969d.6be6c","name":"","rules":[{"t":"set","p":"help","pt":"global","to":"help","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":495,"y":277,"wires":[["7f16357b.4d0cdc"]]},{"id":"3d0d745f.6cadcc","type":"change","z":"44c6969d.6be6c","name":"","rules":[{"t":"set","p":"help","pt":"msg","to":"help","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":734,"y":138,"wires":[["4747696d.be2c88"]]},{"id":"7f16357b.4d0cdc","type":"change","z":"44c6969d.6be6c","name":"","rules":[{"t":"set","p":"door","pt":"msg","to":"door","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":724,"y":276,"wires":[["4747696d.be2c88"]]},{"id":"4747696d.be2c88","type":"template","z":"44c6969d.6be6c","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"These are the two values in one message: {{door}}&{{help}}","output":"str","x":881.5,"y":206,"wires":[["7d2010bf.72b2e8"]]},{"id":"7d2010bf.72b2e8","type":"debug","z":"44c6969d.6be6c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":926.5,"y":350,"wires":[]}]

```

This only works after you have a value for each, but there are ways around that as well.

---

_[View the full topic](https://discourse.nodered.org/t/output-two-attributes-in-the-template/5983)._
