<ul>
{{#devs}}
<li>Device: {{name}}, Location: {{pos}}</li>
{{/devs}}
</ul><ul>{{#payload}}
<li>{{building}}, {{room}}</li>
{{/payload}}</ul>But the template node isn't really the best for generating json. I would recommend you use a function node (or change node) to transform msg.payload to the JavaScript object
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/9366e6bd-ed0f-4b45-8766-d7854a1407c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sorry, my message got cut off... here's a full reply...
Mustache does not provide any features to do that sort of conditional test.
But the template node isn't really the best for generating json. I would recommend you use a function node (or change node) to transform msg.payload to the JavaScript object you want to express as json, and then pass it through the JSON node to stringify it.
Nick