Looking for workspace dropdown

Hi @all,

I'm looking for a node that provides a dropdown on the workspace (not on the dashboard) to select a data set out of a csv, a json or whatever and send it on to the next node.

My idea is to send several hundred of data sets to the node. The node should then store them and provide me with a dropdown where I can select one of the data sets to be send when the node is triggered.
I hope I was able to explain my scenario understandable.

Does anyone know about an existing node / set of nodes with this functionality?

Thank you very much!
Creeps

In the backend, nodes do not store data internally (except for context data) and there is messages come into a node, the node acts on the data and a msg leaves the node (most of the time).

If you haven't already you should view the intro video at https://nodered.org

Hi, welcome to the forum.

I'm afraid that isn't what the admin UI is for. The admin UI isn't for controlling flows dynamically as it were. That is what the Dashboard and other similar user interface nodes are for.

There are many ways to achieve what you want however and it is easy to create a simple UI using Dashboard that will achieve it.

Firstly, you will want the list of datasets somewhere - possibly a file that can be read by Node-RED or even in the settings.js file if they don't change.

A flow would read in the dataset list and use it to build a drop-down in Dashboard. When a user changes the selected entry, that is sent back to your flow which does whatever you need it to.

Thank you both very much for your replies!
I’m familiar with Node-RED in general.

I think I must explain my scenario more clearly:

The user clicks a button on the dashboard. This triggers the flow. The last node in the flow will then, based on the triggered button, send a command to another device (from here on it’s already implemented).

To be able to send this command, the node needs some data (devide id, value to send, …). I mean, speaking of 200 to 300 devices, I must configure a huge amount of dashboard buttons, this is clear.
But I also have to put a node between the dashboard button node and the command sending node to specify which data the last node should use for its command.

So, I could just take a simple function node and do something like {“device id”: 12, “value”: 100, …} for every configured dashboard button. But because this is a lot of work and programmers are lazy, it would be cool to have a node holding all available data sets and providing me with a dropdown (in the backend) to simply choose the device I want to control and the value I want to send, as I already have a list of the data sets as objects / csv / json.

Shortly, what I need is a simple way to link the triggered dashboard button to the corresponding data set in the backend without having to write the whole data set in a function node for every dashboard button.

I hope things are clearer now. Sorry for the complicated explanation.

Looking forward to your replies!

One additional note:

I thought on something similar like the the logitech harmony node:

harmony

This node lets me choose a data set via a dropdown field. I need something like that but with a possibility to add my own data (harmony node discovers the provided data itself) and to let the node send the data to the next node.

If you know what the data is that you have to send and the button will choise the data, why not put the date into something like an sqlite DB - the data from the button is the key, it retrieves the other data and send it on.

Then you could have anoter flow to add/modify/delete items from the database.

If you want to use a dropdown to select the data, you could read the database and populate the dropdown list from it.

Good news, I already have my data in a database :grinning:
Adding a column to the database to assign the dashboard buttons to the data sets is a good idea, thank you!

But what do you mean by your last sentence? How can i populate a dropdown from the data sets coming from the database? This is what I was looking for. I know how to populate a dashboard dropdown from this data, but not how to populate a backend dropdown?

What do you mean by the backend dropdown? You said

The user clicks a button on the dashboard. This triggers the flow. The last node in the flow will then, based on the triggered button, send a command to another device (from here on it’s already implemented).

I'm (maybe correctly) assuming the 'button' would be the dropdown.

No, this button is a ui button. What I'm looking for is a back end dropdown just for my configuration.
Let's say I have a ui button called "light bedroom". When the user clicks on the button, the node sends a message to the next node. If this node provided a dropdown in its configuration in the back end, I could (one time when I'm configuring the flow) choose one of the stored data sets (in this case the data set for "light bedroom"). What I'm imagining is that this node will in the future send on all data belonging to the chosen data set when triggered by the ui button. Sorry, this is so complicated to explain.

ui button -> node with back end dropdown -> rest of flow

I suppose if you wanted to create a custom node and the button was connected to a node that saved the value to a file or db, your custom node could go out and read the value and product the dropdown when you next enteedteh backend.

But there is nothing that will do that that I am aaware of.

Why couldn't the button send data to a node that would retreive the dataset for that button and then send it where ever it needs to go. Or, inseead of a button, have a dropdown of all the names of the datasets and when one is selected it reads that dataset from a DB and sends it on its merry way?

You have all the data you need in a database - so build the Dashboard from the database - then you can give each button the right id from the data, no need to build loads of buttons - just 1 inside a loop over your data. Then when a button is pressed, it sends the ID back to Node-RED and you use that to output to the correct device.

I'm not seeing a problem or a downside to this? Have I missed something?

Here is an example from my home automation system. I'm not using Dashboard but the principle is exactly the same - the data to build the buttons comes from, in this case, a variable that is set from a simple trigger - if I ever need to add more devices, I simply edit the source JSON. I don't ever have to mess with the UI. Even the location info comes from that JSON so that I can group buttons together by location.

Similarly, this device list with detail data is build the same way:

1 Like

Hi all,

sorry for the late reply. Thank ou all very much for your input. I think I'll try the suggestion to create my buttons dynamically.

Have a good week!