# How To Initial Form UI

**URL:** <https://discourse.nodered.org/t/how-to-initial-form-ui/19180>\
**Category:** Dashboard\
**Created:** [15 December 2019 13:37 UTC](https://discourse.nodered.org/t/how-to-initial-form-ui/19180 "2019-12-15T13:37:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [15 December 2019 16:31 UTC](https://discourse.nodered.org/t/how-to-initial-form-ui/19180/2 "2019-12-15T16:31:38Z")

</div>

I assume you are asking how to initialize a form?

This is what I use to pre-fill a drop-down menu.

 ![pre-fiil-form](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/9abe3d4b5bced2ddd744fefb27aa824cd24c34f3.png)

```auto
[{"id":"b5e4059e.5d7a28","type":"inject","z":"4e4657de.9b461","name":"Initial reset","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":190,"y":200,"wires":[["d8ec9a42.ad7708"]]},{"id":"a532c2b5.0e645","type":"ui_dropdown","z":"4e4657de.9b461","name":"Data source","label":"","tooltip":"","place":"","group":"9c66415.50bbe4","order":1,"width":"4","height":"1","passthru":false,"options":[{"label":"","value":"","type":"str"}],"payload":"","topic":"datasource","x":890,"y":200,"wires":[[]]},{"id":"d8ec9a42.ad7708","type":"function","z":"4e4657de.9b461","name":"Set-up name-value map","func":"// This mapping file uses {\"name\":\"value\"} pairs to pre-fill the drop-down widget in the dashboard\n\nmsg.payload = \n[\n {\"[Remove all]\":\"delete\"},\n {\"Lounge temperature\":\"lounge/temperature\"},\n {\"Snug temperature\":\"snug/temperature\"}, \n {\"Studio temperature\":\"studio/temperature\"},\n {\"Study temperature\":\"study/temperature\"},\n {\"Rear bedroom temperature\":\"rear_bedroom/temperature\"},\n {\"Rear bedroom humidity\":\"rear_bedroom/humidity\"},\n {\"Rear bedroom pressure\":\"rear_bedroom/pressure\"},\n {\"Garage temperature\":\"garage/temperature\"},\n {\"Loft temperature\":\"loft/temperature\"}\n];\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":200,"wires":[["cb2b51b0.8fd79"]]},{"id":"cb2b51b0.8fd79","type":"change","z":"4e4657de.9b461","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":200,"wires":[["a532c2b5.0e645"]]},{"id":"52feabff.97a174","type":"comment","z":"4e4657de.9b461","name":"Pre-fill the ui-dropdown widget","info":"","x":550,"y":160,"wires":[]},{"id":"9c66415.50bbe4","type":"ui_group","z":"","name":"Filters","tab":"412738d1.eb7ae","order":2,"disp":true,"width":"24","collapse":false},{"id":"412738d1.eb7ae","type":"ui_tab","z":"","name":"Data capture and charting","icon":"dashboard","order":10}]

```

---

_[View the full topic](https://discourse.nodered.org/t/how-to-initial-form-ui/19180)._
