# Ui\_dropdown node shows m.map is not a function

**URL:** <https://discourse.nodered.org/t/ui-dropdown-node-shows-m-map-is-not-a-function/39306>\
**Category:** Dashboard\
**Created:** [18 January 2021 06:48 UTC](https://discourse.nodered.org/t/ui-dropdown-node-shows-m-map-is-not-a-function/39306 "2021-01-18T06:48:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chc69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chc69/32/34289_2.png) [@chc69](https://discourse.nodered.org/u/chc69)\
**Post date:** [18 January 2021 06:48 UTC](https://discourse.nodered.org/t/ui-dropdown-node-shows-m-map-is-not-a-function/39306/1 "2021-01-18T06:48:20Z")

</div>

Hi

I just face a strange issue with the dropdown node of node-red dashboard.

I set the option as an array as below

```auto
msg.payload = ["option1"];
msg.options = ["option1", "option2", "option3"];

```

And I also set the node as multiple selections  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/7/a755eb2089cf61756294188ce15b6c45e20722e8.png)

But I got an error like this.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/3142476259a26f9b3dd15028846eea7d451c8ce5.png)

Does anyone know what does this mean?  
Here is my flow

```auto
[{"id":"f1a62d2.db357d","type":"ui_dropdown","z":"77940fae.ffea7","name":"","label":"","tooltip":"","place":"Select option","group":"c8c41c36.eb01d","order":8,"width":0,"height":0,"passthru":true,"multiple":true,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"","x":490,"y":680,"wires":[["e6be64b7.f35fa8"]]},{"id":"e6be64b7.f35fa8","type":"debug","z":"77940fae.ffea7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":680,"wires":[]},{"id":"28b367c7.3ff2f8","type":"function","z":"77940fae.ffea7","name":"","func":"\nmsg.payload = [\"option1\"];\n\nmsg.options = [\"option1\", \"option2\", \"option3\"];\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":680,"wires":[["f1a62d2.db357d"]]},{"id":"feefd6da.c723c8","type":"inject","z":"77940fae.ffea7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":680,"wires":[["28b367c7.3ff2f8"]]},{"id":"c8c41c36.eb01d","type":"ui_group","name":"Operation","tab":"860db091.a0872","order":3,"disp":true,"width":"6","collapse":false},{"id":"860db091.a0872","type":"ui_tab","name":"Modbus Control Panel","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [18 January 2021 09:00 UTC](https://discourse.nodered.org/t/ui-dropdown-node-shows-m-map-is-not-a-function/39306/2 "2021-01-18T09:00:22Z")

</div>

When you unclick "if message arrives pass through" the error goes away.

The error is from the dropdown node and is saying, That map is not a function that can be preformed on m as m is not an array.

Also the `msg.payload = ["option1"];` does not need to be an array `= "option1";` is correct

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [18 January 2021 09:51 UTC](https://discourse.nodered.org/t/ui-dropdown-node-shows-m-map-is-not-a-function/39306/3 "2021-01-18T09:51:44Z")

</div>

hi - ah yes - slight bug in there... ☹  
will be sorted.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 February 2021 09:51 UTC](https://discourse.nodered.org/t/ui-dropdown-node-shows-m-map-is-not-a-function/39306/4 "2021-02-17T09:51:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
