# Export Grafana data to CSV file from NodeRed Dashboard

**URL:** <https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238>\
**Category:** Dashboard\
**Created:** [6 August 2020 17:18 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238 "2020-08-06T17:18:48Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [6 August 2020 17:18 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/1 "2020-08-06T17:18:48Z")

</div>

I have integrated Grafana chart into NodeRed Dashboard by following the flow here: [https://flows.nodered.org/flow/8e96b8630c4edc866aa0459354033c9b/in/u1hmO7pQPVSi](https://flows.nodered.org/flow/8e96b8630c4edc866aa0459354033c9b/in/u1hmO7pQPVSi)  
Now I am wondering if we can export the data shown in the Grafana chart to CSV file directly, instead of creating another flow to export data from Influxdb? In Grafana, there is an option to Inspect data and then export the data to CSV file. How can I enable this option in NodeRed Dashboard?

Thanks in advance.

---

<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:** [6 August 2020 17:45 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/2 "2020-08-06T17:45:03Z")

</div>

Why wold you do this? If you want the chart in your dashboard add a ui\_template node with an iframe pointing to the url of the grafana graph.

---

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [6 August 2020 18:05 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/3 "2020-08-06T18:05:41Z")

</div>

I want to limit what users can do. If I just simply give the url to the chart, then many other options such as the GUI for Grafana will also show up.  
I am attaching a picture and you will see what I mean. If I just simply give the url, then the stuff circled in red will also show up.

 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2ac3d1ae88f22050dce725501e40898ae072d38.jpeg)

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [7 August 2020 09:44 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/4 "2020-08-07T09:44:07Z")

</div>

I think you are doing something wrong, is not ok that you got the Grafana options in your NR dashboard.  
The result should look like the example flow.  
What version of Grafana are you using?

---

<div class="post-metadata">

**Author:** ![mudwalker](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mudwalker](https://discourse.nodered.org/u/mudwalker)\
**Post date:** [7 August 2020 11:35 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/5 "2020-08-07T11:35:42Z")

</div>

I have noticed that If you choose KIOSK mode when you copy the link from the URL, no controls are displayed when the graph is displayed on Node Red Dashboard. Or at least, non that do any harm!

---

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [7 August 2020 17:15 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/6 "2020-08-07T17:15:26Z")

</div>

I was trying to answer zenofmud's question about simply pointing the URL.

The result I got is indeed like the example flow without Grafana options.

What I want is the selected Grafana option such as "Inspect"-\>"Data"-\>"Export CSV". The other options don't show in Dashboard.  
FYI, here is the real Grafana chart imbedded in my dashboard:

 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a294c036c97d6ad68799509199f5097e6bad2e47.jpeg)

---

<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 August 2020 17:20 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/7 "2020-08-07T17:20:26Z")

</div>

So what you want to know is does Gragfana have an API that will return the current data of a Grafana dashboard...right? If that is so, then I don't know you might try looking thru the Grafana documentation and asking on the Grafana site (though I hear support is not very good)

---

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [7 August 2020 17:26 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/8 "2020-08-07T17:26:03Z")

</div>

Exactly 🙂 This forum is amazing with quick reply. I guess I have to try my luck with Grafana site.

I do have backup plan to query data from Influx with another flow and then transfer data via http, which I try to avoid to save system resource.

---

<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 August 2020 20:23 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/9 "2020-08-07T20:23:31Z")

</div>

Why would you need to transfer it via http?  
I doubt if you need to worry about the system resource used to fetch it from influx, I suspect that is what grafana will do if it is capable of providing a csv file. I doubt if it would go direct from the graph as that will not necessarily have enough information to generate the csv, much more likely it would go back to influx again to get the data.

---

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [7 August 2020 20:56 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/10 "2020-08-07T20:56:47Z")

</div>

I am running Node Red, Influx and Grafana on a remote computer. Data analysis is done on a local machine. So the backup plan is to query the influx, save data file on the remote computer, then transfer the data file to my local machine.

If I use Grafana to query influx for 7 days data, it takes several seconds to generate the graph (The longer the days, the longer for it to load). Later on, if I choose "inspect"-\>"data", the CSV data is instantly available. So it is likely that Grafana does not go back to query the influx again.

---

<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 August 2020 21:02 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/11 "2020-08-07T21:02:31Z")

</div>

> [@davidz](#):
>
> So it is likely that Grafana does not go back to query the influx again.

In retrospect I think you may well be right, I stand corrected.

---

<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:** [8 August 2020 07:43 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/12 "2020-08-08T07:43:39Z")

</div>

As a matter of interest, if you refresh the graph does it still take 7 seconds?

---

<div class="post-metadata">

**Author:** ![davidz](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@davidz](https://discourse.nodered.org/u/davidz)\
**Post date:** [8 August 2020 21:25 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/13 "2020-08-08T21:25:33Z")

</div>

Yes it takes several seconds to refresh 7 days data, and it takes longer time for longer days.

---

<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:** [9 August 2020 12:38 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/14 "2020-08-09T12:38:51Z")

</div>

OK, just checking it wasn't the db driver that was caching the result.

---

<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:** [8 September 2020 12:38 UTC](https://discourse.nodered.org/t/export-grafana-data-to-csv-file-from-nodered-dashboard/31238/15 "2020-09-08T12:38:55Z")

</div>

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