# 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:** 2

<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:** [7 June 2018 09:56 UTC](https://discourse.nodered.org/t/how-set-the-output-variable-msg-payload-in-js/657/2 "2018-06-07T09:56:50Z")

</div>

Try this for the code in your template:

````auto
<table id="table" border="1">
     <tr>
        <th>First Name</th> 
        <th>Last Name</th>
        <th>Age</th>
 </tr>
 <tbody>
 <tr ng-repeat="row in msg.payload" ng-dblclick="sendRow(row)">
   <td ng-repeat="item in row" class="numeric" bgcolor=gray>{{item}}</td>
 <td>
 </tr>
 </tbody>
</table>```
````

---

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