Reset dropdown in dashboard with msg.reset while preserving it's previous value

Hello . Is it possible to reset dropdown node with msg.reset, just like how we did it with text input node? I want it to preserve it's previous msg.payload after each time the value goes to the join node.

This is the first time I input the data, with all the parameter recently inputted:

After that, I tried to change the dropdown value, then push the button and this is how it goes:


The join node immediately receive text input, with it's previous value.

However, when I tried to only change the text value, and then press the button, the join node send nothing. This indicate the msg.reset doesn't work the same as text input.

Is there anything I miss on this case? Or did you guys have a better ideas to do this? I also avoid using subsequent option since there will be time I use timestamp every second, but maybe you guys know how to get over it with some tricks so feel free to share it. Thank you very much

[
    {
        "id": "0f5d167769d53171",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "7833a85dffc90b56",
        "type": "ui_dropdown",
        "z": "0f5d167769d53171",
        "name": "",
        "label": "",
        "tooltip": "",
        "place": "Select option",
        "group": "7c12f85c9c65c62f",
        "order": 2,
        "width": 0,
        "height": 0,
        "passthru": true,
        "multiple": false,
        "options": [
            {
                "label": "1",
                "value": "value1",
                "type": "str"
            },
            {
                "label": "2",
                "value": "value2",
                "type": "str"
            }
        ],
        "payload": "",
        "topic": "topic",
        "topicType": "msg",
        "className": "",
        "x": 160,
        "y": 40,
        "wires": [
            [
                "279812b4b328ae27"
            ]
        ]
    },
    {
        "id": "e0a5e02062fc1e3a",
        "type": "ui_text_input",
        "z": "0f5d167769d53171",
        "name": "",
        "label": "",
        "tooltip": "",
        "group": "7c12f85c9c65c62f",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": true,
        "mode": "text",
        "delay": "0",
        "topic": "topic",
        "sendOnBlur": true,
        "className": "",
        "topicType": "msg",
        "x": 160,
        "y": 200,
        "wires": [
            [
                "53dbcd14344deb58"
            ]
        ]
    },
    {
        "id": "a68cfc105b2d9bdc",
        "type": "join",
        "z": "0f5d167769d53171",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "3",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 570,
        "y": 140,
        "wires": [
            [
                "3d132138993efd1a",
                "b153696f302252d2"
            ]
        ]
    },
    {
        "id": "3d132138993efd1a",
        "type": "change",
        "z": "0f5d167769d53171",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "reset",
                "tot": "msg",
                "dc": true
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 200,
        "wires": [
            [
                "e0a5e02062fc1e3a",
                "7833a85dffc90b56"
            ]
        ]
    },
    {
        "id": "b153696f302252d2",
        "type": "debug",
        "z": "0f5d167769d53171",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 730,
        "y": 100,
        "wires": []
    },
    {
        "id": "782190ab1cbe319e",
        "type": "ui_button",
        "z": "0f5d167769d53171",
        "name": "",
        "group": "7c12f85c9c65c62f",
        "order": 3,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "button",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 250,
        "y": 260,
        "wires": [
            [
                "d01550a22653970f"
            ]
        ]
    },
    {
        "id": "d01550a22653970f",
        "type": "change",
        "z": "0f5d167769d53171",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "button",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 430,
        "y": 260,
        "wires": [
            [
                "a68cfc105b2d9bdc"
            ]
        ]
    },
    {
        "id": "53dbcd14344deb58",
        "type": "change",
        "z": "0f5d167769d53171",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "text",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 160,
        "wires": [
            [
                "a68cfc105b2d9bdc"
            ]
        ]
    },
    {
        "id": "279812b4b328ae27",
        "type": "change",
        "z": "0f5d167769d53171",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "dropdown",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 370,
        "y": 40,
        "wires": [
            [
                "a68cfc105b2d9bdc"
            ]
        ]
    },
    {
        "id": "7c12f85c9c65c62f",
        "type": "ui_group",
        "name": "Default",
        "tab": "bdf6348413fab83a",
        "order": 1,
        "disp": false,
        "width": "6",
        "collapse": false,
        "className": ""
    },
    {
        "id": "bdf6348413fab83a",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

you should be able to feed in msg.payload with blank value to reset the ui nodes.
e.g.

[{"id":"7833a85dffc90b56","type":"ui_dropdown","z":"0f5d167769d53171","name":"","label":"","tooltip":"","place":"Select option","group":"7c12f85c9c65c62f","order":2,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"1","value":"value1","type":"str"},{"label":"2","value":"value2","type":"str"}],"payload":"","topic":"topic","topicType":"msg","className":"","x":160,"y":40,"wires":[["279812b4b328ae27","7eae3e3.c4a24c"]]},{"id":"dd7dcb5b.2ba06","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":260,"wires":[["e0a5e02062fc1e3a","7833a85dffc90b56"]]},{"id":"279812b4b328ae27","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"dropdown","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":40,"wires":[["a68cfc105b2d9bdc"]]},{"id":"7eae3e3.c4a24c","type":"debug","z":"0f5d167769d53171","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":660,"y":40,"wires":[]},{"id":"a68cfc105b2d9bdc","type":"join","z":"0f5d167769d53171","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":570,"y":140,"wires":[["b153696f302252d2","dd7dcb5b.2ba06"]]},{"id":"e0a5e02062fc1e3a","type":"ui_text_input","z":"0f5d167769d53171","name":"","label":"","tooltip":"","group":"7c12f85c9c65c62f","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":160,"y":200,"wires":[["53dbcd14344deb58"]]},{"id":"d01550a22653970f","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"button","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":260,"wires":[["a68cfc105b2d9bdc"]]},{"id":"53dbcd14344deb58","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"text","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":160,"wires":[["a68cfc105b2d9bdc"]]},{"id":"b153696f302252d2","type":"debug","z":"0f5d167769d53171","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":100,"wires":[]},{"id":"782190ab1cbe319e","type":"ui_button","z":"0f5d167769d53171","name":"","group":"7c12f85c9c65c62f","order":3,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":250,"y":260,"wires":[["d01550a22653970f"]]},{"id":"7c12f85c9c65c62f","type":"ui_group","name":"Default","tab":"bdf6348413fab83a","order":1,"disp":false,"width":"6","collapse":false,"className":""},{"id":"bdf6348413fab83a","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Thanks for reply, but unfortunately thats not what I would like to do. Maybe i wasn't clear enough. What I want is using the same value as the previous one without selecting / clicking it once again ( just like picture #2). The msg.reset rewrite the value exactly as it is into join node once more, and I would like this msg.reset also affecting the dropdown node.
In the end, I believe this should allow me to press the button as much as I want to give join node a complete topic, without inserting anything to either dropdown or text node more than one time. This is pretty much how i wanted it to be ( with exchanging dropdown with another text input node ):

That 2nd output from join node only done by using the button.

then just feed the payloads back to the ui nodes
e.g

[{"id":"7833a85dffc90b56","type":"ui_dropdown","z":"0f5d167769d53171","name":"","label":"","tooltip":"","place":"Select option","group":"7c12f85c9c65c62f","order":2,"width":0,"height":0,"passthru":false,"multiple":false,"options":[{"label":"1","value":"value1","type":"str"},{"label":"2","value":"value2","type":"str"}],"payload":"","topic":"topic","topicType":"msg","className":"","x":160,"y":40,"wires":[["279812b4b328ae27","7eae3e3.c4a24c"]]},{"id":"279812b4b328ae27","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"dropdown","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":40,"wires":[["a68cfc105b2d9bdc","7833a85dffc90b56"]]},{"id":"7eae3e3.c4a24c","type":"debug","z":"0f5d167769d53171","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":660,"y":40,"wires":[]},{"id":"a68cfc105b2d9bdc","type":"join","z":"0f5d167769d53171","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":570,"y":140,"wires":[["b153696f302252d2"]]},{"id":"d01550a22653970f","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"button","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":260,"wires":[["a68cfc105b2d9bdc"]]},{"id":"53dbcd14344deb58","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"text","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":160,"wires":[["a68cfc105b2d9bdc","e0a5e02062fc1e3a"]]},{"id":"b153696f302252d2","type":"debug","z":"0f5d167769d53171","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":100,"wires":[]},{"id":"782190ab1cbe319e","type":"ui_button","z":"0f5d167769d53171","name":"","group":"7c12f85c9c65c62f","order":3,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":250,"y":260,"wires":[["d01550a22653970f"]]},{"id":"e0a5e02062fc1e3a","type":"ui_text_input","z":"0f5d167769d53171","name":"","label":"","tooltip":"","group":"7c12f85c9c65c62f","order":1,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":160,"y":200,"wires":[["53dbcd14344deb58"]]},{"id":"7c12f85c9c65c62f","type":"ui_group","name":"Default","tab":"bdf6348413fab83a","order":1,"disp":false,"width":"6","collapse":false,"className":""},{"id":"bdf6348413fab83a","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Making sure to deselect pass through option

Or if you want to keep pass through move the payloads back to msg. payload after the join node.
e.g.

[{"id":"7833a85dffc90b56","type":"ui_dropdown","z":"0f5d167769d53171","name":"","label":"","tooltip":"","place":"Select option","group":"7c12f85c9c65c62f","order":2,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"value1","value":"1","type":"str"},{"label":"value2","value":"2","type":"str"}],"payload":"","topic":"topic","topicType":"msg","className":"","x":160,"y":40,"wires":[["279812b4b328ae27","7eae3e3.c4a24c"]]},{"id":"433a45e1.247374","type":"trigger","z":"0f5d167769d53171","name":"","op1":" ","op2":"","op1type":"str","op2type":"pay","duration":"250","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":970,"y":180,"wires":[["7833a85dffc90b56"]]},{"id":"279812b4b328ae27","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"dropdown","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":40,"wires":[["a68cfc105b2d9bdc"]]},{"id":"7eae3e3.c4a24c","type":"debug","z":"0f5d167769d53171","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":660,"y":40,"wires":[]},{"id":"39dca13f.034a7e","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.dropdown","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":180,"wires":[["433a45e1.247374"]]},{"id":"a68cfc105b2d9bdc","type":"join","z":"0f5d167769d53171","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":570,"y":140,"wires":[["b153696f302252d2","39dca13f.034a7e","222c1a76.eb0816"]]},{"id":"d01550a22653970f","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"button","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":260,"wires":[["a68cfc105b2d9bdc"]]},{"id":"53dbcd14344deb58","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"text","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":160,"wires":[["a68cfc105b2d9bdc"]]},{"id":"b153696f302252d2","type":"debug","z":"0f5d167769d53171","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":100,"wires":[]},{"id":"222c1a76.eb0816","type":"change","z":"0f5d167769d53171","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.text","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":220,"wires":[["c61b0329.cb872"]]},{"id":"782190ab1cbe319e","type":"ui_button","z":"0f5d167769d53171","name":"","group":"7c12f85c9c65c62f","order":3,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":250,"y":260,"wires":[["d01550a22653970f"]]},{"id":"e0a5e02062fc1e3a","type":"ui_text_input","z":"0f5d167769d53171","name":"","label":"","tooltip":"","group":"7c12f85c9c65c62f","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":160,"y":200,"wires":[["53dbcd14344deb58"]]},{"id":"c61b0329.cb872","type":"trigger","z":"0f5d167769d53171","name":"","op1":" ","op2":"","op1type":"str","op2type":"pay","duration":"250","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":990,"y":220,"wires":[["e0a5e02062fc1e3a"]]},{"id":"7c12f85c9c65c62f","type":"ui_group","name":"Default","tab":"bdf6348413fab83a","order":1,"disp":false,"width":"6","collapse":false,"className":""},{"id":"bdf6348413fab83a","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

As you can not send the same value twice you would need to a trigger nodes to, first send a new value then old value.

2 Likes

Once again, you help me! Thank you so much!

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