# Creating dropdown with label:value pair

**URL:** <https://discourse.nodered.org/t/creating-dropdown-with-label-value-pair/29011>\
**Category:** Dashboard\
**Created:** [26 June 2020 05:03 UTC](https://discourse.nodered.org/t/creating-dropdown-with-label-value-pair/29011 "2020-06-26T05:03:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [26 June 2020 09:30 UTC](https://discourse.nodered.org/t/creating-dropdown-with-label-value-pair/29011/2 "2020-06-26T09:30:54Z")

</div>

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](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506), 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.

 ![Screen Shot 2020-06-26 at 5.29.48 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/4/84c55c572de34ea599f522c795638fccfa292ff9.png)  
I took a look at your function node and came up with a different way of doing it using [jsonata](https://jsonata.org) in a change node. See if this works as a replacement for your function node.

```auto
[{"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!

---

_[View the full topic](https://discourse.nodered.org/t/creating-dropdown-with-label-value-pair/29011)._
