A tutorial on how to add a dropdown to the node edit properties of a subflow

Hi, I have created a custom node using a subflow. One of the fields that I want in the edit properties for the new node is a dropdown containing "up", "down", "left", "right" rather than requiring the user of the node to input those strings to the field. It seems from browsing here and other locations on the internet that it is possible to do this, but I can't find a definitive set of steps to add dropdowns to a node edit properties view. Is it possible to do this?
Some caveats:

  • I see lots of 'snippets' of how to do this, just nothing that goes through the steps of adding a dropdown, is it possible it exists somewhere and I just haven't found it?
  • I am talking about adding a dropdown to the edit properties dialog for a node, not the dashboard (seems like quite a bit of confusion on this front from posts I see)
  • I am not a JavaScript expert but I understand the basics and know how to add JavaScript to html, just not sure where/how to add it to Node-Red if that is the solution

Thanks in advance for any pointers!

Hi @mitch-shiver

It's easier to visualise the steps, so here is one I made earlier :smiley:

Mar-07-2024 18-37-29

Note : I added the subflow tag to this post

1 Like

Can't get any more straightforward than that, glad that I did not go down the rabbit hole of adding custom JavaScript for this. Thanks!

1 Like