Ui_dropdown no reaction to input payload if passing through

NODE-RED: v1.2.6 on Raspi Model 3B running Buster
ui_dashboard version: 2.26.1

Documentation says:
" Setting msg.payload will pre-select the value in the dropdown."

Nowehere can I find the fact that this only works if the user does NOT tick " If msg arrives on input, pass through to output". If that option is selected then all msg.payload input is ignored, making it impossible to reset the dropdown programtically.

Is this by design or is it a bug? What am I missing?

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

NR 1.3.5
Dashboard v2.29.1 and v2.30.0

While trying something for a project I'm working on, I hit this same issue, the
If msg arrives on input, pass through to output:
option seems to be ignored.

Taking a look at the code and comparing it to ui_text, I can not figure out how the passthru works.

@dceejay, any hints or pointers to what I should look for in the ui_dropdown's code?

Which way doesn't it work ? do you have a small example ?

Here is a small flow showing the issue

[ { "id": "c0cbd894.a69f48", "type": "inject", "z": "170f950f.540b8b", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" }, { "p": "object", "v": "[{\"Camera-1\":\"cam1\"},{\"Camera-2\":\"cam2\"},{\"Camera-3\":\"cam3\"},{\"Camera-4\":\"cam4\"},{\"Show media 2\":\"med2\"},{\"Show media 5\":\"med5\"}]", "vt": "json" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "Camera-2", "payloadType": "str", "x": 640, "y": 580, "wires": [ [ "e05207bf.b24e1" ] ] }, { "id": "e05207bf.b24e1", "type": "ui_dropdown", "z": "170f950f.540b8b", "name": "Main_Display", "label": "", "tooltip": "", "place": "Select camera source>>", "group": "8712765e.3efe98", "order": 3, "width": 0, "height": 0, "passthru": true, "multiple": false, "options": [], "payload": "", "topic": "main_display", "topicType": "str", "x": 820, "y": 580, "wires": [ [ "9786b516.47a1b8" ] ] }, { "id": "9786b516.47a1b8", "type": "debug", "z": "170f950f.540b8b", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 970, "y": 580, "wires": [] }, { "id": "8712765e.3efe98", "type": "ui_group", "name": "Main_Display_Area", "tab": "f8095777.501678", "order": 3, "disp": false, "width": "12", "collapse": false }, { "id": "f8095777.501678", "type": "ui_tab", "name": "Home Surveillance System", "icon": "dashboard", "disabled": false, "hidden": false } ]```

the payload you have to inject has to match the value of the dropdown - not the label.

[{"id":"c0cbd894.a69f48","type":"inject","z":"c929e2e7887a5d65","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"options","v":"[{\"Camera-1\":\"cam1\"},{\"Camera-2\":\"cam2\"},{\"Camera-3\":\"cam3\"},{\"Camera-4\":\"cam4\"},{\"Show media 2\":\"med2\"},{\"Show media 5\":\"med5\"}]","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"cam2","payloadType":"str","x":130,"y":500,"wires":[["e05207bf.b24e1"]]},{"id":"e05207bf.b24e1","type":"ui_dropdown","z":"c929e2e7887a5d65","name":"Main_Display","label":"","tooltip":"","place":"Select camera source>>","group":"8712765e.3efe98","order":3,"width":0,"height":0,"passthru":true,"multiple":false,"options":[],"payload":"","topic":"main_display","topicType":"str","x":320,"y":500,"wires":[["9786b516.47a1b8"]]},{"id":"9786b516.47a1b8","type":"debug","z":"c929e2e7887a5d65","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":470,"y":500,"wires":[]},{"id":"8712765e.3efe98","type":"ui_group","name":"Main_Display_Area","tab":"f8095777.501678","order":3,"disp":false,"width":"12","collapse":false},{"id":"f8095777.501678","type":"ui_tab","name":"Home Surveillance System","icon":"dashboard","disabled":false,"hidden":false}]

Ahhh, thanks Dave! What confused me is the configuration options show:
Screen Shot 2021-07-13 at 12.20.01 PM
.
And the Help text starts off saying .

Multiple value / label pairs can be added as required. If the label is not specified the value will be used for both.

Then but if you specity them in msg.options you have to reverse the order and use Label/Value.

The Options may be configured by inputting msg.options containing an array. If just text then the value will be the same as the label, otherwise you can specify both by using an object of "label":"value" pairs :

And the fact that I was sending msg.option as a string didn't help either :woozy_face:

I'm guessing changing the order - for msg.options - could effect current users flows so I think adding a bolded line to the end of the Options paragraph
Note, this is the opposite of the order entered in the node configuration
would be helpful