# Render buttons from a sql array

**URL:** <https://discourse.nodered.org/t/render-buttons-from-a-sql-array/17225>\
**Category:** Dashboard\
**Created:** [28 October 2019 10:19 UTC](https://discourse.nodered.org/t/render-buttons-from-a-sql-array/17225 "2019-10-28T10:19:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hardworker](https://avatars.discourse-cdn.com/v4/letter/h/f4b2a3/32.png) [@Hardworker](https://discourse.nodered.org/u/Hardworker)\
**Post date:** [28 October 2019 10:19 UTC](https://discourse.nodered.org/t/render-buttons-from-a-sql-array/17225/1 "2019-10-28T10:19:25Z")

</div>

hello every body ,  
i m new in NODE RED and i want to create buttons from an array returned from sql.  
can any body help with that .  
thank you

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [28 October 2019 10:29 UTC](https://discourse.nodered.org/t/render-buttons-from-a-sql-array/17225/2 "2019-10-28T10:29:38Z")

</div>

A button has a name and an action, so what are you returning in your array?  
Perhaps you could share an example?

---

<div class="post-metadata">

**Author:** ![Hardworker](https://avatars.discourse-cdn.com/v4/letter/h/f4b2a3/32.png) [@Hardworker](https://discourse.nodered.org/u/Hardworker)\
**Post date:** [28 October 2019 10:44 UTC](https://discourse.nodered.org/t/render-buttons-from-a-sql-array/17225/3 "2019-10-28T10:44:34Z")

</div>

hi ukmouse,  
the array got values as [first,second,third]  
for example : the first created button have to take value of the first element [first] as label and when clicked return the same value (first) as string

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [28 October 2019 11:10 UTC](https://discourse.nodered.org/t/render-buttons-from-a-sql-array/17225/4 "2019-10-28T11:10:24Z")

</div>

The difficulty comes in that an array can contain any number of entries so I can't think of a way of dynamically doing it with the dashboard buttons.  
But you could do it with html or using the node-red-contrib-uibuilder tool

---

<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:** [28 October 2019 12:07 UTC](https://discourse.nodered.org/t/render-buttons-from-a-sql-array/17225/5 "2019-10-28T12:07:55Z")

</div>

How about creating a dynamic table where race row is clickable and returns the value?

Search the flow tab for flows using the keyword ‘table’

---

<div class="post-metadata">

**Author:** ![Hardworker](https://avatars.discourse-cdn.com/v4/letter/h/f4b2a3/32.png) [@Hardworker](https://discourse.nodered.org/u/Hardworker)\
**Post date:** [28 October 2019 12:58 UTC](https://discourse.nodered.org/t/render-buttons-from-a-sql-array/17225/6 "2019-10-28T12:58:08Z")

</div>

> [@zenofmud](#):
>
> flow tab for flows using the keyword ‘table’

can u please share an example?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [28 October 2019 13:22 UTC](https://discourse.nodered.org/t/render-buttons-from-a-sql-array/17225/7 "2019-10-28T13:22:03Z")

</div>

> [@zenofmud](#):
>
> Search the flow tab for flows using the keyword ‘table’

[https://flows.nodered.org/search?term=table&type=flow](https://flows.nodered.org/search?term=table&type=flow)

---

<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:** [28 October 2019 15:14 UTC](https://discourse.nodered.org/t/render-buttons-from-a-sql-array/17225/8 "2019-10-28T15:14:24Z")

</div>

If you want to see a working project, look at my project [‘ET Display Home’ a flow to help manage your ESPeasy and Sonoff/Tasmota flashed devices (now at v0.1.13)](https://discourse.nodered.org/t/et-display-home-a-flow-to-help-manage-your-espeasy-and-sonoff-tasmota-flashed-devices-now-at-v0-1-13/1893)

You will notice the IP addresses are all links.
