Display dropdown option inside mustach template node


#1

i'am trying to display my dropdown option inside a mustache template node. at the same time this template display a liste of payload cames from another template.
So, i put msg.paylod that comes from dropdown node to a msg.topic then i try to display it inside a template node.

<html>
    <body>
        <b>Reference : {{topic}}!!!!!</b>
        <ol>
{{# payload}}
<div style= "float: none;display: block;text-align: right;">
        {{data3}}
         </div>
 <li> {{data1}} {{data2}} </li>
{{/ payload}}
<ol>
    </body>
</html>

{{topic}} does not showing.


#2

See a working flow, so you compare with yours and check what has to be fixed

[{"id":"678d524a.61308c","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"73b45631.824ac8","type":"inject","z":"678d524a.61308c","name":"","topic":"","payload":"{}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":160,"wires":[["593d3298.ca094c"]]},{"id":"593d3298.ca094c","type":"change","z":"678d524a.61308c","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"This is the Topic","tot":"str"},{"t":"set","p":"payload.data1","pt":"msg","to":"This is data1","tot":"str"},{"t":"set","p":"payload.data2","pt":"msg","to":"This is data2","tot":"str"},{"t":"set","p":"payload.data3","pt":"msg","to":"This is data3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":160,"wires":[["6d1e3819.0b8d98","d4e1d270.fca94"]]},{"id":"c68c8332.fe7d6","type":"debug","z":"678d524a.61308c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":830,"y":160,"wires":[]},{"id":"6d1e3819.0b8d98","type":"debug","z":"678d524a.61308c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":500,"y":240,"wires":[]},{"id":"d4e1d270.fca94","type":"template","z":"678d524a.61308c","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<body>\n    <b>Reference : {{topic}}!!!!!</b>\n    <ol>\n        {{#payload}}\n        <div style= \"float: none;display: block;text-align: right;\">\n            {{data3}}\n        </div>\n        <li> {{data1}} </li>\n        <li> {{data2}} </li>\n        {{/payload}}\n    </ol>\n</body>\n","output":"str","x":520,"y":160,"wires":[["a165be93.ac8ab"]]},{"id":"a165be93.ac8ab","type":"ui_template","z":"678d524a.61308c","group":"a94f24a4.167ac8","name":"","order":0,"width":"12","height":"6","format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":660,"y":160,"wires":[["c68c8332.fe7d6"]]},{"id":"a94f24a4.167ac8","type":"ui_group","z":"","name":"Test","tab":"122fb7fe.900498","order":1,"disp":true,"width":"12","collapse":false},{"id":"122fb7fe.900498","type":"ui_tab","z":"","name":"Test","icon":"dashboard","order":3}]

r-01


#3

ok thank you sir. i will try it