# How to bind the data in template mustache node in array of json format

**URL:** <https://discourse.nodered.org/t/how-to-bind-the-data-in-template-mustache-node-in-array-of-json-format/13002>\
**Category:** General\
**Created:** [7 July 2019 15:21 UTC](https://discourse.nodered.org/t/how-to-bind-the-data-in-template-mustache-node-in-array-of-json-format/13002 "2019-07-07T15:21:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tamiloli.it](https://avatars.discourse-cdn.com/v4/letter/t/258eb7/32.png) [@tamiloli.it](https://discourse.nodered.org/u/tamiloli.it)\
**Post date:** [7 July 2019 15:21 UTC](https://discourse.nodered.org/t/how-to-bind-the-data-in-template-mustache-node-in-array-of-json-format/13002/1 "2019-07-07T15:21:42Z")

</div>

Hi,  
I am using template mustache, I get the data into db and convert to json format; After getting data in json how to display in template mustache html; there is any other option use jquery bind the data, please guide me;  
For eg:{"date":[.,.,.,.],"order":[.,.,.,.,.]}

---

<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 July 2019 16:38 UTC](https://discourse.nodered.org/t/how-to-bind-the-data-in-template-mustache-node-in-array-of-json-format/13002/2 "2019-07-07T16:38:07Z")

</div>

If you are asking how to use the template node to create an sql insert statement I am currently trying to write a cookbook entry doing that very thing. As I haven't gotten it finished I'll just give you the flow:

```auto
[{"id":"dca16302.b2567","type":"debug","z":"1abdb162.af5277","name":"TEMPLATE","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":150,"y":300,"wires":[]},{"id":"dba7856c.25b5b","type":"template","z":"1abdb162.af5277","name":"","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"INSERT INTO temperature (\n temperature,\n humidity,\n look,\n detail\n)\nVALUES (\n {{payload.tempc}},\n {{payload.humidity}},\n \"{{payload.weather}}\",\n \"{{payload.detail}}\"\n);","output":"str","x":160,"y":220,"wires":[["dca16302.b2567"]]},{"id":"ca1b1b7d.aed2b","type":"inject","z":"1abdb162.af5277","name":"","topic":"","payload":"{\"tempc\":45,\"humidity\":16.4,\"weather\":\"Clear\",\"detail\":\"Sunny all day\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":140,"wires":[["dba7856c.25b5b"]]}]

```

---

<div class="post-metadata">

**Author:** ![tamiloli.it](https://avatars.discourse-cdn.com/v4/letter/t/258eb7/32.png) [@tamiloli.it](https://discourse.nodered.org/u/tamiloli.it)\
**Post date:** [7 July 2019 17:03 UTC](https://discourse.nodered.org/t/how-to-bind-the-data-in-template-mustache-node-in-array-of-json-format/13002/3 "2019-07-07T17:03:37Z")

</div>

I'm not asking insertion, how to display data into template mustache; I'm use the node in function node and get data into object; after that use the template node css,scrip and Html this are all the node linked between httprequest;

---

<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 July 2019 17:33 UTC](https://discourse.nodered.org/t/how-to-bind-the-data-in-template-mustache-node-in-array-of-json-format/13002/4 "2019-07-07T17:33:09Z")

</div>

So you have retreived data from a database and want to display it.

Have you searched in the [flows tab](https://flows.nodered.org/?num_pages=1) for example flows displaying a two dimensional table?
