# How to give the table data in throught the http in node red dashboard using api call

**URL:** https://discourse.nodered.org/t/how-to-give-the-table-data-in-throught-the-http-in-node-red-dashboard-using-api-call/90037
**Category:** Dashboard
**Tags:** http-request
**Created:** [7 August 2024 14:17 UTC](https://discourse.nodered.org/t/how-to-give-the-table-data-in-throught-the-http-in-node-red-dashboard-using-api-call/90037 "2024-08-07T14:17:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Nandhini-Subramaniya](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nandhini-subramaniya/32/92882_2.png) [@Nandhini-Subramaniya](https://discourse.nodered.org/u/Nandhini-Subramaniya)
#### Post date: [7 August 2024 14:17 UTC](https://discourse.nodered.org/t/how-to-give-the-table-data-in-throught-the-http-in-node-red-dashboard-using-api-call/90037/1 "2024-08-07T14:17:02Z")

</div>

How to provide JSON data for a table in a Node-RED dashboard using an API call within a template, I used an inject node and a function node where I supplied the JSON data. Then, I connected it to an HTTP input node, and finally to a template node containing my table."  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/1/d11525c350cf57d54e662c20653ff02bea3e0a7b.png)  
IN function node:  
msg.payload = {"desserts":[{"name":"Ice cream sandwich","calories":237,"fat":9,"carbs":37,"protein":4.3,"iron":1,"gluten":true},{"name":"Eclair","calories":262,"fat":16,"carbs":24,"protein":6,"iron":7,"gluten":true},{"name":"Cupcake","calories":305,"fat":3.7,"carbs":67,"protein":4.3,"iron":8,"gluten":false}]};

return msg;  
this is my template node code

 {{ isGroupOpen(item) ? '$expand' : '$next' }} {{ item.value ? 'Contains gluten' : 'Gluten free' }}

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [6 September 2024 14:17 UTC](https://discourse.nodered.org/t/how-to-give-the-table-data-in-throught-the-http-in-node-red-dashboard-using-api-call/90037/2 "2024-09-06T14:17:05Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
