# Pass msg object containing HTML to \<select\> in UI template

**URL:** <https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882>\
**Category:** Dashboard\
**Created:** [31 July 2019 21:55 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882 "2019-07-31T21:55:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lbee11](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@Lbee11](https://discourse.nodered.org/u/Lbee11)\
**Post date:** [31 July 2019 21:55 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882/1 "2019-07-31T21:55:23Z")

</div>

I am trying to pass a msg that contains the string value "numbers". "numbers" contains options for a dropdown box as HTML.

This is the msg object I am using:  
 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8b5000693257f10bf8e42d208eec2e5c96336175.png)

And this is the code in my template node:

```auto
<table id="table" border="1">
 <tr>
 <th>Duty</th> 
 <th>Name</th>
 </tr>

 <tbody>
 <tr ng-repeat="row in msg.payload">
 <td align="center" ng-repeat="item in row" >{{item}}</td>
 <td>
     <select>
         {{numbers}}
     </select>
 </td>
 </tr>
 </tbody>

</table>

```

How to I get the "numbers" data to appear between the `<select></select>`? If I paste the actual value of "numbers" there, the UI renders the dropdown box correctly. Currently I just get a blank dropdown

EDIT:  
Here is how the UI looks:  
 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/bc07427bc7b384cd6d9d3caeef2545d2f74acfdf.png)

The repeat is reading the "First Duty" etc from the array and is working correctly, but the second column should be populated with a drop down containing the options defined in the "numbers" string.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [31 July 2019 21:58 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882/2 "2019-07-31T21:58:29Z")

</div>

Look at the debug node again.

`msg.payload` is an array with 4 elements (unknown what they are).  
`msg.number` contains a string.

Your template is repeating `row in msg.payload`, not `numbers`

---

<div class="post-metadata">

**Author:** ![Lbee11](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@Lbee11](https://discourse.nodered.org/u/Lbee11)\
**Post date:** [31 July 2019 21:59 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882/3 "2019-07-31T21:59:56Z")

</div>

The first

 is working correctly, I am passing both an array and a string.  
The array works correctly. I'll update my questions to make things clearer

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [31 July 2019 22:00 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882/4 "2019-07-31T22:00:51Z")

</div>

The first works because you have a property called `numbers`

---

<div class="post-metadata">

**Author:** ![Lbee11](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@Lbee11](https://discourse.nodered.org/u/Lbee11)\
**Post date:** [31 July 2019 22:03 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882/5 "2019-07-31T22:03:04Z")

</div>

I have updated my question

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [31 July 2019 22:05 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882/6 "2019-07-31T22:05:33Z")

</div>

Got it, i was confused. Perhaps it is caused by the double quotes in `value` ? Although I am not sure you can pass html to the template node.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 July 2019 22:06 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882/7 "2019-07-31T22:06:15Z")

</div>

Is this a ui-template that uses angular or a regular template node that uses moustache ?

---

<div class="post-metadata">

**Author:** ![Lbee11](https://avatars.discourse-cdn.com/v4/letter/l/58f4c7/32.png) [@Lbee11](https://discourse.nodered.org/u/Lbee11)\
**Post date:** [31 July 2019 22:07 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882/8 "2019-07-31T22:07:20Z")

</div>

It's a UI\_Template node

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 July 2019 22:08 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882/9 "2019-07-31T22:08:55Z")

</div>

Looks (to me) like it should be a regular template node. Then feed that into a ui-template node (with its default content of html bind)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [31 July 2019 22:09 UTC](https://discourse.nodered.org/t/pass-msg-object-containing-html-to-select-in-ui-template/13882/10 "2019-07-31T22:09:51Z")

</div>

Or maybe try {{msg.numbers}}
