# Setting Dropdown in input text node

**URL:** <https://discourse.nodered.org/t/setting-dropdown-in-input-text-node/83661>\
**Category:** Dashboard\
**Tags:** node-red-dashboard\
**Created:** [13 December 2023 08:31 UTC](https://discourse.nodered.org/t/setting-dropdown-in-input-text-node/83661 "2023-12-13T08:31:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subiksha](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@Subiksha](https://discourse.nodered.org/u/Subiksha)\
**Post date:** [13 December 2023 08:31 UTC](https://discourse.nodered.org/t/setting-dropdown-in-input-text-node/83661/1 "2023-12-13T08:31:57Z")

</div>

Hi all !!  
I would like to know how to set up a drop down in text input where the dropdown contains values from sql database. actually I am sure how to retrieve values from database and show it in the ui. but not sure how to set up a dropdown and connect the dropdown to sql database. Seeking any support !

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 December 2023 11:39 UTC](https://discourse.nodered.org/t/setting-dropdown-in-input-text-node/83661/2 "2023-12-13T11:39:48Z")

</div>

If you look at the help text for the dropdown node it tells you how to use msg.options to set the options.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 December 2023 12:51 UTC](https://discourse.nodered.org/t/setting-dropdown-in-input-text-node/83661/3 "2023-12-13T12:51:49Z")

</div>

Here is an example flow:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/5/65cbb70f87a932278ed3f7c46d83dffa51c72cca.png)

```auto
[{"id":"ebb59c2d73f361df","type":"inject","z":"5a7428fa9c18cd3d","name":"Sample data","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"id\":8,\"name\":\"Bates Thomas\"},{\"id\":2,\"name\":\"Catesby Robert\"},{\"id\":13,\"name\":\"Digby Everard\"},{\"id\":6,\"name\":\"Fawkes Guy\"},{\"id\":11,\"name\":\"Grant John\"},{\"id\":7,\"name\":\"Keyes Robert\"},{\"id\":5,\"name\":\"Percy Thomas\"},{\"id\":12,\"name\":\"Rookwood Ambrose\"},{\"id\":1,\"name\":\"Tresham Francis\"},{\"id\":4,\"name\":\"Wintour Thomas\"},{\"id\":9,\"name\":\"Wintour Robert\"},{\"id\":10,\"name\":\"Wright Christopher\"},{\"id\":3,\"name\":\"Wright John\"}]","payloadType":"json","x":150,"y":80,"wires":[["986031f1625cdd96","1d704a43291664a4"]]},{"id":"4585d7e591448a4e","type":"debug","z":"5a7428fa9c18cd3d","name":"Options","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"options","targetType":"msg","statusVal":"","statusType":"auto","x":540,"y":120,"wires":[]},{"id":"986031f1625cdd96","type":"change","z":"5a7428fa9c18cd3d","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"$$.payload.{ $.name:$string($.id)}[]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":120,"wires":[["4585d7e591448a4e","39d3920713922e4d"]]},{"id":"1d704a43291664a4","type":"debug","z":"5a7428fa9c18cd3d","name":"Input data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":540,"y":80,"wires":[]},{"id":"39d3920713922e4d","type":"ui_dropdown","z":"5a7428fa9c18cd3d","name":"","label":"Staff member","tooltip":"","place":"Select option","group":"4f625e8062b00521","order":11,"width":"6","height":"1","passthru":true,"multiple":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"topic","topicType":"msg","className":"","x":360,"y":160,"wires":[["723ca253da8cbc37"]]},{"id":"723ca253da8cbc37","type":"debug","z":"5a7428fa9c18cd3d","name":"Chosen staff ID (string)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":590,"y":160,"wires":[]},{"id":"c01254a9f26c871c","type":"comment","z":"5a7428fa9c18cd3d","name":"select id, concat(surn, \" \", firstn) as name from staff order by surn;","info":"","x":290,"y":40,"wires":[]},{"id":"4f625e8062b00521","type":"ui_group","name":"Test","tab":"44cb81d560c73ae5","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"44cb81d560c73ae5","type":"ui_tab","name":"Test","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<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:** [12 January 2024 12:52 UTC](https://discourse.nodered.org/t/setting-dropdown-in-input-text-node/83661/4 "2024-01-12T12:52:12Z")

</div>

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