Question about `drop-down` node

NR 2.0.1
Dashboard 2.28.1

Is there a way to set a default/start option?

Say I have 5 options.
I want #2 to be the selected as default.

How?

Reading the docs I can't work out how to do this.

Feeding in payload set to the value of the option you wish preselected should work according to the help info in the side panel

Setting msg.payload to one of the item values will preset the choice in the dropdown. If using the multi-select option then the payload should be an array of values.

e.g. sets option 3 to preset

[{"id":"f441c974.c69d58","type":"inject","z":"b779de97.b1b46","name":"","props":[{"p":"payload"},{"p":"options","v":"[1,2,3,4]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"3","payloadType":"num","x":110,"y":4900,"wires":[["b8f62a0d.697b38"]]},{"id":"b8f62a0d.697b38","type":"ui_dropdown","z":"b779de97.b1b46","name":"","label":"","tooltip":"","place":"Select option","group":"8b5cde76.edd58","order":12,"width":0,"height":0,"passthru":true,"multiple":false,"options":[],"payload":"","topic":"topic","topicType":"msg","x":180,"y":4940,"wires":[[]]},{"id":"8b5cde76.edd58","type":"ui_group","name":"","tab":"8f03e639.85956","order":1,"disp":true,"width":"12","collapse":false},{"id":"8f03e639.85956","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
1 Like

Strange I didn't understand what was written in the info panel to say that could be done.

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