NR v2.2.2 Dashboard v3.1.7
I've been beating my head about this and it should be easy but my 'Foo' is failing today (and it's hot outside and in) This is a simple example of what I want (I'm actualy building a parts inventory).
As you can see there is a dropdown (created in a ui-template) and a Quantity (ui-numeric) and a Button (ui-button).
The idea is to select the fruit and enter a quantity and press the button and build an object with both the fruit and the quantity in the msg.payload. My idea is when you enter the quantity, I stuff it in a flow variable. I want to do the same when a 'fruit' is picked an dfinally when the button is pressed, grab the flow variables and put them in msg.payload and send them off for further processing.
My issue is I can't figure out how to return the 'fruit' from the ui-template. Any pointers will be gratefully welcomed. Attached is my test flow.
[{"id":"0d33c07f75d87cc0","type":"ui_button","z":"a1151f479fc9edf7","name":"","group":"23d2ed50f8e0ebd0","order":1,"width":"4","height":"1","passthru":false,"label":"Submit","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"go","topicType":"str","x":340,"y":220,"wires":[["1ceea1b1470cf9a8","78e170279241a57b"]]},{"id":"7664e90b169098a0","type":"debug","z":"a1151f479fc9edf7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":950,"y":240,"wires":[]},{"id":"827b7245e6bf8e64","type":"debug","z":"a1151f479fc9edf7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":60,"wires":[]},{"id":"1ceea1b1470cf9a8","type":"ui_template","z":"a1151f479fc9edf7","group":"c3180d6ecfee774b","name":"Fruit","order":1,"width":"4","height":"1","format":"<div ng-bind-html=\"msg.payload\"></div>\n <label for=\"fruits\">Choose a Fruit:</label>\n\n<select name=\"fruits\" id=\"fruits\">\n <option value=\"apple\">apple</option>\n <option value=\"banana\">banana</option>\n <option value=\"peach\">peach</option>\n <option value=\"watermelon\">watermelon</option>\n</select>\n\n\n","storeOutMessages":true,"fwdInMessages":false,"resendOnRefresh":true,"templateScope":"local","className":"","x":330,"y":160,"wires":[["b2441671cc4b70fb","800cc9d44cb60701"]]},{"id":"ee98c7531ac328a4","type":"inject","z":"a1151f479fc9edf7","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":125,"y":100,"wires":[["1ceea1b1470cf9a8","c255f3e1a80ff062"]],"l":false},{"id":"b2441671cc4b70fb","type":"debug","z":"a1151f479fc9edf7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":140,"wires":[]},{"id":"ed22a7fb39d76b7b","type":"change","z":"a1151f479fc9edf7","name":"","rules":[{"t":"set","p":"quantity","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":100,"wires":[[]]},{"id":"800cc9d44cb60701","type":"change","z":"a1151f479fc9edf7","name":"","rules":[{"t":"set","p":"fruit","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":180,"wires":[["a13bb2e83c24712f"]]},{"id":"a13bb2e83c24712f","type":"change","z":"a1151f479fc9edf7","name":"","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.quantity","pt":"msg","to":"quantity","tot":"flow"},{"t":"set","p":"payload.fruit","pt":"msg","to":"fruit","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":960,"y":180,"wires":[["7664e90b169098a0"]]},{"id":"ae07a5d7e58b0e34","type":"catch","z":"a1151f479fc9edf7","name":"","scope":null,"uncaught":false,"x":400,"y":280,"wires":[["873153e1b7b670f3"]]},{"id":"873153e1b7b670f3","type":"debug","z":"a1151f479fc9edf7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":590,"y":280,"wires":[]},{"id":"78e170279241a57b","type":"debug","z":"a1151f479fc9edf7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":510,"y":220,"wires":[]},{"id":"c255f3e1a80ff062","type":"ui_numeric","z":"a1151f479fc9edf7","name":"","label":"Quantity","tooltip":"","group":"c3180d6ecfee774b","order":2,"width":"4","height":"1","wrap":false,"passthru":false,"topic":"topic","topicType":"msg","format":"{{value}}","min":0,"max":10,"step":1,"className":"","x":340,"y":100,"wires":[["827b7245e6bf8e64","ed22a7fb39d76b7b"]]},{"id":"23d2ed50f8e0ebd0","type":"ui_group","name":"submit","tab":"a088985c1d3b62a3","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"c3180d6ecfee774b","type":"ui_group","name":"inventory","tab":"a088985c1d3b62a3","order":1,"disp":true,"width":"12","collapse":false,"className":""},{"id":"a088985c1d3b62a3","type":"ui_tab","name":"Supermarket","icon":"dashboard","order":1,"disabled":false,"hidden":false}]