Hi,
I created simple subflow with one input, and one output.
Subflow has 3 properties: unit_test, unit_type, unit_tell. All of them are dropdowns with two options and string values.
Inside subflow there are function, that reads environment variables:
msg.env = [ env.get("unit_test"), env.get("unit_type"), env.get("unit_tell") ];
return msg;
On my flow, at subflow output I got this: ["opt1",null,"asdf"]
It means, that env.get("unit_type")
always return null
.
I tested this on multiple PCs and there is always this problem.
What wrong with "unit_type"
?
Node-red version: 1.0.6
Nodes to test:
[{"id":"818111e.14a84f","type":"subflow","name":"test","info":"","category":"","in":[{"x":600,"y":320,"wires":[{"id":"aac98841.4feec8"}]}],"out":[{"x":880,"y":320,"wires":[{"id":"aac98841.4feec8","port":0}]}],"env":[{"name":"unit_test","type":"str","value":"opt1","ui":{"icon":"font-awesome/fa-arrow-circle-down","label":{"en-US":"Unit test"},"type":"select","opts":{"opts":[{"l":{"en-US":"opt1"},"v":"opt1"},{"l":{"en-US":"opt2"},"v":"opt2"}]}}},{"name":"unit_type","type":"str","value":"aaa","ui":{"icon":"font-awesome/fa-align-left","label":{"en-US":"Unit type"},"type":"select","opts":{"opts":[{"l":{"en-US":"aaa"},"v":"aaa"},{"l":{"en-US":"bbb"},"v":"bbb"}]}}},{"name":"unit_tell","type":"str","value":"asdf","ui":{"icon":"font-awesome/fa-compass","label":{"en-US":"Unit tell"},"type":"select","opts":{"opts":[{"l":{"en-US":"asdf"},"v":"asdf"},{"l":{"en-US":"qwer"},"v":"qwer"}]}}}],"color":"#DDAA99"},{"id":"aac98841.4feec8","type":"function","z":"818111e.14a84f","name":"","func":"msg.env = [ env.get(\"unit_test\"), env.get(\"unit_type\"), env.get(\"unit_tell\") ];\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":320,"wires":[[]]},{"id":"259922d3.db2c6e","type":"debug","z":"f31cfc67.f14fb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":830,"y":1840,"wires":[]},{"id":"a85acf85.0a113","type":"subflow:818111e.14a84f","z":"f31cfc67.f14fb","name":"","env":[{"name":"unit_type","value":"bbb","type":"str"}],"x":660,"y":1840,"wires":[["259922d3.db2c6e"]]},{"id":"555ec225.0c57bc","type":"inject","z":"f31cfc67.f14fb","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":480,"y":1840,"wires":[["a85acf85.0a113"]]}]