Dashboard 2 - Dynamic Dropdown

@Buckskin The new option can be shown by adding a msg.payload value to the new option. For example, you can use msg.payload=2700, which will show the new option.

@joepavitt There is a minor bug: In dynamic dropdown, when user selects a dropdown item, the msg.options is also passed through to the dropdown output. This should be removed to improve efficiency. We could have thousands of items in the msg.options.

[{"id":"f9846d3950ef8306","type":"inject","z":"c689a2b989f10d2e","name":"Inject","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"Options","x":470,"y":1120,"wires":[["3a1f7a565c93068d"]]},{"id":"3a1f7a565c93068d","type":"function","z":"c689a2b989f10d2e","name":"Set Dropdown option 1","func":"msg.options = [\n    {\n        value: 2700,\n        label: \"Warm White\"\n    },\n    {\n        value: 3000,\n        label: \"Soft White\"\n    },\n    {\n        value: 4000,\n        label: \"Bright White\"\n    },\n    {\n        value: 6500,\n        label: \"Day Light\"\n    }\n]\nmsg.payload = 3000;\nreturn msg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":1120,"wires":[["5406f8b212556adf"]]},{"id":"5406f8b212556adf","type":"ui-dropdown","z":"c689a2b989f10d2e","group":"ec377c5983068f8b","name":"","label":"Select Option:","tooltip":"","order":0,"width":0,"height":0,"passthru":false,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"topic","topicType":"msg","className":"","x":920,"y":1160,"wires":[["0f60e2240d04df60"]]},{"id":"0f60e2240d04df60","type":"debug","z":"c689a2b989f10d2e","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1080,"y":1160,"wires":[]},{"id":"0b9435fc9f5afc87","type":"function","z":"c689a2b989f10d2e","name":"Set Dropdown option 2","func":"msg.options = [\n    {\n        value: \"a\",\n        label: \"Option a\"\n    },\n    {\n        value: \"b\",\n        label: \"Option b\"\n    },\n]\nmsg.payload = \"a\";\nreturn msg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":1220,"wires":[["5406f8b212556adf"]]},{"id":"39d8f2c6be5a633d","type":"inject","z":"c689a2b989f10d2e","name":"Inject","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"Options","x":470,"y":1220,"wires":[["0b9435fc9f5afc87"]]},{"id":"ec377c5983068f8b","type":"ui-group","name":"Alarms","page":"541b0afcb626191f","width":"8","height":"1","order":-1,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"541b0afcb626191f","type":"ui-page","name":"Alarms","ui":"b29695b2081eca86","path":"/alarms","icon":"alarm-light","layout":"grid","theme":"0fa083067f4afa84","order":2,"className":"","visible":"true","disabled":"false"},{"id":"b29695b2081eca86","type":"ui-base","name":"server","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false},{"id":"0fa083067f4afa84","type":"ui-theme","name":"Default","colors":{"surface":"#ffffff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]