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

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

Typically, i would suggest the join node 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 using change nodes. Then upon pressing the button, retrieve the context values.

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.

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?

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

I want to create something like this:

Try doing what i said instead:

example:

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

[{"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

dashboard 2

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

1 Like

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

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.

Dashboard.

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