# How set the output variable "{{msg.payload}}" in JS?!

**URL:** <https://discourse.nodered.org/t/how-set-the-output-variable-msg-payload-in-js/657>\
**Category:** General\
**Created:** [7 June 2018 09:41 UTC](https://discourse.nodered.org/t/how-set-the-output-variable-msg-payload-in-js/657 "2018-06-07T09:41:32Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [7 June 2018 16:50 UTC](https://discourse.nodered.org/t/how-set-the-output-variable-msg-payload-in-js/657/12 "2018-06-07T16:50:23Z")

</div>

Anytime you need to post a chunk of code or formatted text, put a line before and after it that contains only 3 backtics – that will keep it from escaping your quotes and such.

You can try it out by editing the last post… just open your `ui_template` node, select all the code inside the edit panel, and paste it between the backtic lines.

Please see [this post](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506) for more information on how to effectively post here

---

_[View the full topic](https://discourse.nodered.org/t/how-set-the-output-variable-msg-payload-in-js/657)._
