# How to access Grafana dashboard with a ui button

**URL:** <https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001>\
**Category:** General\
**Created:** [7 July 2019 14:36 UTC](https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001 "2019-07-07T14:36:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nassima100](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@nassima100](https://discourse.nodered.org/u/nassima100)\
**Post date:** [7 July 2019 14:36 UTC](https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001/1 "2019-07-07T14:36:35Z")

</div>

Hello; I'm trying to view the history by accessing Grafana dashboard from my node-red dashboard when I click on a button , but the access isn't authorized , I tried to replace "localhost" or 127.0.0.1 with the IP address of my raspberry pi , but I still can't access it, if I type the same link on my url bar it directs me to the grafana login page than to the dashboard I want to access.

```auto
[{"id":"195063e9.d5324c","type":"ui_button","z":"1f72a396.dd2dcc","name":"","group":"334534ab.9b33fc","order":1,"width":"5","height":"1","passthru":false,"label":"<a class=\"link\" href=\"http://localhost:8889/d/5HOvvp4Wk/smart-green-app?orgId=1&kiosk\">l'historique</a>&nbsp&nbsp <img height=\"20px\" width=\"25px\" src=\"/gr.png\" />","tooltip":"","color":"","bgcolor":"#ddb6c6","icon":"","payload":"","payloadType":"str","topic":"","x":2176.0521507263184,"y":129.67711067199707,"wires":[[]]},{"id":"334534ab.9b33fc","type":"ui_group","z":"","name":"Group 9","tab":"6223b67a.9315e8","order":4,"disp":false,"width":"5","collapse":false},{"id":"6223b67a.9315e8","type":"ui_tab","z":"","name":"Tableau de bord","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

---

<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:30 UTC](https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001/2 "2019-07-07T16:30:02Z")

</div>

Where are you going to get the data from to look at?  
Have you searched the forum using 'grafana' to see how others are using it?  
Can you access the granafa history using the address in a browser outside of NR?

Also the flow you provide is just a `ui_button` node and in it you have set the _label_ to some HTML. That is not going to work, what is in the _label_ option just shows in the dashboard as the label of the button.

---

<div class="post-metadata">

**Author:** ![nassima100](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@nassima100](https://discourse.nodered.org/u/nassima100)\
**Post date:** [7 July 2019 16:47 UTC](https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001/3 "2019-07-07T16:47:22Z")

</div>

So you're saying that this is illogical !

---

<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:42 UTC](https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001/4 "2019-07-07T17:42:06Z")

</div>

I'm saying anything you put in a `ui_button` node's **label** option only displays on the button in the dashboard. If you change the label option to 'STOP' then the label will show.  
 ![56%20PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8bece079e61020ef4c378e2def1a67acea675262.png)  
It is not used for any thing else.

Attach a `debug` node (set to display the 'complete msg object' and you will see what happens. As explained in the Info tab for the `ui_button` node;

> Clicking the button generates a message with `msg.payload` set to the **Payload** field. If no payload is specified, the node id is used.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 July 2019 19:22 UTC](https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001/5 "2019-07-07T19:22:23Z")

</div>

I think one option would be to make the button bring up an iframe containing the grafana page.

---

<div class="post-metadata">

**Author:** ![nassima100](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@nassima100](https://discourse.nodered.org/u/nassima100)\
**Post date:** [7 July 2019 19:35 UTC](https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001/6 "2019-07-07T19:35:46Z")

</div>

@zenofmud Actually, it works try this one for example:  
`[{"id":"3ec370c7.bf8f6","type":"ui_button","z":"276447cb.393008","name":"","group":"ea687868.82aba8","order":20,"width":"6","height":"1","passthru":false,"label":" <a href=\"https://www.google.com/\" >Link</a>","tooltip":"","color":"","bgcolor":"#a1c45a","icon":"","payload":"","payloadType":"str","topic":"","x":570,"y":60,"wires":[[]]},{"id":"ea687868.82aba8","type":"ui_group","z":"","name":"Météo","tab":"8219815a.93f9e","order":1,"disp":false,"width":"6","collapse":false},{"id":"8219815a.93f9e","type":"ui_tab","z":"","name":"Tableau de bord","icon":"dashboard","order":1,"disabled":false,"hidden":false}]`

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 July 2019 20:54 UTC](https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001/7 "2019-07-07T20:54:15Z")

</div>

The example doesn't work for me.

---

<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 22:27 UTC](https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001/8 "2019-07-07T22:27:17Z")

</div>

Well I stand corrected, you are correct, it does work, but my guess is that it was never intended for that purpose

@dceejay - what is your take on adding html link code to the label of a button - or any dashboard element?

Addala, If you take `http://localhost:8889/d/5HOvvp4Wk/smart-green-app?orgId=1&kiosk` and enter it into a browser, does it work?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 July 2019 22:47 UTC](https://discourse.nodered.org/t/how-to-access-grafana-dashboard-with-a-ui-button/13001/9 "2019-07-07T22:47:34Z")

</div>

My take ? It's your dashboard to do with what you will.
