Hello everybody,
Im currently working on a school project and im having a problem: Im using a form in nodered dashboard to let the user input a bunch of numeric configuration values that are then converted into a json format and sent via mqtt to an esp32. This works fine, but I'd like to add the feature that the input fields are already populated with the current set values, so that the user only needs to change the values of interest instead of entering all values again. The current set values are reciever via mqtt and are formatted in the same json format. Is there a way to do this?
This is my subflow right now:
[{"id":"57e0f48f.2095cc","type":"inject","z":"f63bb00e.623cd8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":110,"y":80,"wires":[["7bc2234f.756184"]]},{"id":"7bc2234f.756184","type":"change","z":"f63bb00e.623cd8","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"['fruits','vegetables','drinks']","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"fruits","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":220,"y":140,"wires":[["3bcb1d68.454592"]]},{"id":"3bcb1d68.454592","type":"ui_dropdown","z":"f63bb00e.623cd8","name":"","label":"","tooltip":"","place":"Select option","group":"2f028802.e68d","order":1,"width":0,"height":0,"passthru":true,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":390,"y":140,"wires":[["fe9c6f12.2e1cc"]]},{"id":"fe9c6f12.2e1cc","type":"switch","z":"f63bb00e.623cd8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"fruits","vt":"str"},{"t":"eq","v":"vegetables","vt":"str"},{"t":"eq","v":"drinks","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":450,"y":220,"wires":[["f49503bd.72a76"],["b7303574.28e768"],["f8d4e225.5471f"]]},{"id":"f49503bd.72a76","type":"change","z":"f63bb00e.623cd8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{'title':'apples'},{'title':'bananas'},{'title':'oranges'}]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":180,"wires":[["118429a4.b9a3b6"]]},{"id":"b7303574.28e768","type":"change","z":"f63bb00e.623cd8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{'title':'maize'},{'title':'beans'},{'title':'squash'}]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":220,"wires":[["118429a4.b9a3b6"]]},{"id":"f8d4e225.5471f","type":"change","z":"f63bb00e.623cd8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[{'title':'beer'},{'title':'wine'},{'title':'water'}]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":260,"wires":[["118429a4.b9a3b6"]]},{"id":"118429a4.b9a3b6","type":"ui_list","z":"f63bb00e.623cd8","group":"2f028802.e68d","name":"","order":2,"width":"0","height":"0","lineType":"two","actionType":"click","allowHTML":false,"x":790,"y":220,"wires":[["bb4e2eca.92bcd"]]},{"id":"bb4e2eca.92bcd","type":"debug","z":"f63bb00e.623cd8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":930,"y":220,"wires":[]},{"id":"2f028802.e68d","type":"ui_group","z":"","name":"Test","tab":"cb94cd6.524bd3","order":2,"disp":true,"width":"6","collapse":false},{"id":"cb94cd6.524bd3","type":"ui_tab","z":"","name":"NR Discussion","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
Any help would be greatly appreciated, thanks!