# Help with Node-RED Dashboard for InfluxDB2 Query Using Date, Time, and CSV Export

**URL:** <https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036>\
**Category:** Dashboard\
**Tags:** node-red-dashboard, database\
**Created:** [17 September 2024 07:07 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036 "2024-09-17T07:07:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristophHerrx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christophherrx/32/94600_2.png) [@ChristophHerrx](https://discourse.nodered.org/u/ChristophHerrx)\
**Post date:** [17 September 2024 07:07 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/1 "2024-09-17T07:07:24Z")

</div>

Hi everyone,

I'm working on a Node-RED project where I want to input a date and time through the dashboard. Based on these inputs, I need to query an InfluxDB2 database. The retrieved data should be displayed in plain text on the dashboard, and I also want to provide the option to export this data as a CSV file.

### Requirements:

1. **Input date and time in the dashboard.**
2. **Query the InfluxDB2 database** based on the entered values.
3. **Display the query results in plain text** on the dashboard.
4. **Provide an option to export the data as a CSV file.**

### Problems:

- Struggling to combine the date and time inputs for querying the database.
- Issues with implementing the CSV export after fetching the data.

If anyone has any suggestions or guidance on how to solve this, I would greatly appreciate it!

Thanks in advance!  
Christoph

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bf8b4c5d873010025573cb22822af8a4105534b1.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 September 2024 07:14 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/2 "2024-09-17T07:14:42Z")

</div>

> [@ChristophHerrx](#):
>
> Struggling to combine the date and time inputs for querying the database.

Typically, i would suggest the [join node](https://cookbook.nodered.org/basic/join-streams) for gathering all your inputs (and that still is a viable option) but since you want to use them after clicking a separate button, i would suggest you gather inputs in [context](https://nodered.org/docs/user-guide/context) using change nodes. Then upon pressing the button, retrieve the context values.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d63eb79e47ac774be3217a30d428fc478629b0ae.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [17 September 2024 07:17 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/3 "2024-09-17T07:17:02Z")

</div>

To add to Steve's response. You should also be able to use the dashboard form node to input all the inputs, this would not require a join node then, and has a submit button.

You should also be able to send your db result through a CSV node to create your CSV.

---

<div class="post-metadata">

**Author:** ![ChristophHerrx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christophherrx/32/94600_2.png) [@ChristophHerrx](https://discourse.nodered.org/u/ChristophHerrx)\
**Post date:** [17 September 2024 07:36 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/4 "2024-09-17T07:36:24Z")

</div>

Thanks for the replay. I couldn't find a dashboard form that allows me to enter the date with a specific time. You have any recomendations?

---

<div class="post-metadata">

**Author:** ![ChristophHerrx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christophherrx/32/94600_2.png) [@ChristophHerrx](https://discourse.nodered.org/u/ChristophHerrx)\
**Post date:** [17 September 2024 07:40 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/5 "2024-09-17T07:40:27Z")

</div>

I tryed to fix the date issue with your hints. But I stuck already.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/1309304d42aa9520c502005034ef9afa65ad314c.png)

---

<div class="post-metadata">

**Author:** ![ChristophHerrx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christophherrx/32/94600_2.png) [@ChristophHerrx](https://discourse.nodered.org/u/ChristophHerrx)\
**Post date:** [17 September 2024 07:40 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/6 "2024-09-17T07:40:57Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/037e4ab60cd37cf2053d6374d6a24925665fa0f8.png)

---

<div class="post-metadata">

**Author:** ![ChristophHerrx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christophherrx/32/94600_2.png) [@ChristophHerrx](https://discourse.nodered.org/u/ChristophHerrx)\
**Post date:** [17 September 2024 07:41 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/7 "2024-09-17T07:41:42Z")

</div>

I want to create something like this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0c47ca1b376eaa1fee382d8a18fa81d18ba465ab.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 September 2024 07:42 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/8 "2024-09-17T07:42:58Z")

</div>

Try doing what i said instead:

> [@Steve-Mcl](#):
>
> i would suggest you gather inputs in [context](https://nodered.org/docs/user-guide/context) using change nodes. Then upon pressing the button, retrieve the context values.
> 
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d63eb79e47ac774be3217a30d428fc478629b0ae.png)

example:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/e/0ea222829cc0081d52bac36bcf100676a40ec439.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [17 September 2024 07:55 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/9 "2024-09-17T07:55:06Z")

</div>

There are forms in dashboard and dashboard 2  
both allow time and date input.  
e.g.

```auto
[{"id":"49a4015ccf537a6f","type":"ui_form","z":"d1395164b4eec73e","name":"","label":"","group":"2d4fe667.28f8ba","order":1,"width":0,"height":0,"options":[{"label":"a","value":"a","type":"date","required":true,"rows":null},{"label":"b","value":"b","type":"time","required":true,"rows":null}],"formValue":{"a":"","b":""},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":270,"y":7600,"wires":[[]]},{"id":"8dc9cedf52ddc2b3","type":"ui-form","z":"d1395164b4eec73e","name":"","group":"ff7cbf009b7b3034","label":"","order":0,"width":0,"height":0,"options":[{"label":"a","key":"a","type":"date","required":true,"rows":null},{"label":"b","key":"b","type":"time","required":true,"rows":null}],"formValue":{"a":"","b":""},"payload":"","submit":"submit","cancel":"clear","resetOnSubmit":true,"topic":"topic","topicType":"msg","splitLayout":"","className":"","passthru":false,"dropdownOptions":[],"x":370,"y":7460,"wires":[[]]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"Demo","tab":"0ca01f1e15e69b4d","order":2,"disp":true,"width":"18","collapse":false,"className":""},{"id":"ff7cbf009b7b3034","type":"ui-group","name":"Form","page":"3bceecc44f91d26b","width":"6","height":"1","order":1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"0ca01f1e15e69b4d","type":"ui_tab","name":"demo","icon":"dashboard","disabled":false,"hidden":false},{"id":"3bceecc44f91d26b","type":"ui-page","name":"Custom Form Submission","ui":"1805777f90e92057","path":"/form-submission","icon":"home","layout":"grid","theme":"35ee7753b5b3599b","order":1,"className":"","visible":true,"disabled":false},{"id":"1805777f90e92057","type":"ui-base","name":"dashboard","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"showPageTitle":true,"titleBarStyle":"default"},{"id":"35ee7753b5b3599b","type":"ui-theme","name":"Theme Name","colors":{"surface":"#16234b","primary":"#1d44b9","bgPage":"#ecf2f8","groupBg":"#ffffff","groupOutline":"#cccccc"}}]

```

node-red dashboard

 ![chrome_screenshot_17 Sep 2024 09_07_40 BST](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/39fbd7cf95f43986830afd0f6b96326fa5a1371a.png)

dashboard 2

 ![chrome_screenshot_17 Sep 2024 08_58_11 BST](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/34e9ff3f524538a07b7f62015311ce4a8c6e6ca2.png)

Both can be set to two columns, as in dashboard image.

---

<div class="post-metadata">

**Author:** ![ChristophHerrx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christophherrx/32/94600_2.png) [@ChristophHerrx](https://discourse.nodered.org/u/ChristophHerrx)\
**Post date:** [17 September 2024 11:53 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/10 "2024-09-17T11:53:58Z")

</div>

This is a realy good hint. I'll use this option.

---

<div class="post-metadata">

**Author:** ![ChristophHerrx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christophherrx/32/94600_2.png) [@ChristophHerrx](https://discourse.nodered.org/u/ChristophHerrx)\
**Post date:** [17 September 2024 12:00 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/11 "2024-09-17T12:00:44Z")

</div>

Thanks for your support. I'll use the idea from E1cid. Its cleaner than my idea. But right now im struggeling with my outcome.  
I just get one line as an output.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0dc02454d98518a404236113c60760f4c2bdad6f.png)

---

<div class="post-metadata">

**Author:** ![ChristophHerrx](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christophherrx/32/94600_2.png) [@ChristophHerrx](https://discourse.nodered.org/u/ChristophHerrx)\
**Post date:** [17 September 2024 12:01 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/12 "2024-09-17T12:01:17Z")

</div>

Dashboard.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ff6e12f5f38869af422432d93bc9948f3a35627b.png)

---

<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:** [17 October 2024 12:01 UTC](https://discourse.nodered.org/t/help-with-node-red-dashboard-for-influxdb2-query-using-date-time-and-csv-export/91036/13 "2024-10-17T12:01:26Z")

</div>

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