Creating dropdown with label:value pair

Jon, welcome to the forum!

First off a terminology lesson. The export is not called a tree, it is called a flow - a term that everyone acknowledges is over loaded since a collection of nodes connected by wires is called a flow and all your nodes on all your tabs is also called a 'flow'. I must say though, 'tree' would be a good way of reducing what is called a flow.

second, when pasting in a flow, make sure to surround it with back-tics. If you read this thread, it will tell you what to do. Also the condensed version takes up less room in the threads so when exporting, select the compact tab in the export window.


I took a look at your function node and came up with a different way of doing it using jsonata in a change node. See if this works as a replacement for your function node.

[{"id":"155c212b.e3d0df","type":"change","z":"3500c4d4.375684","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"payload.{name:fan_id}\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":100,"wires":[["a47943bd.e90c8","986b9d56.25ffd"]]}]

Note: jsonata can seem scary, confusing and magical but it is awesome!

2 Likes