# Dropdown list

**URL:** <https://forum.inductiveautomation.com/t/dropdown-list/10533>\
**Category:** Ignition\
**Created:** [September 28, 2015, 2:13pm UTC](https://forum.inductiveautomation.com/t/dropdown-list/10533 "2015-09-28T14:13:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![the\_newb](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@the\_newb](https://forum.inductiveautomation.com/u/the_newb)\
**Post date:** [September 28, 2015, 2:13pm UTC](https://forum.inductiveautomation.com/t/dropdown-list/10533/1 "2015-09-28T14:13:47Z")

</div>

I have a dropdown list component that has around 100 selections in it. The list is updated by a query that is sorted by the the most recent being at the top of the list.

The thing is, whenever I open my list, it is always on the last item in the list, so I have to go down, scroll all of the way to the top to get to the most recent.

Is there a way I can start with the first item in the list selected so this extra step isn’t necessary?

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [September 28, 2015, 2:15pm UTC](https://forum.inductiveautomation.com/t/dropdown-list/10533/2 "2015-09-28T14:15:19Z")

</div>

does the table you are querying have an id column? if so add order by id desc to your query.

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [September 28, 2015, 2:24pm UTC](https://forum.inductiveautomation.com/t/dropdown-list/10533/3 "2015-09-28T14:24:26Z")

</div>

There are a number of ways to set which item in your drop down are selected.

If you always want to have the first item selected, try `dropdown = event.source.parent.getComponent('Dropdown')
dropdown.setSelectedIndex(0)`

You can also select specific items – check out [the docs](https://docs.inductiveautomation.com/display/DOC/Dropdown+List) for drop downs to see how to select items by value or label.

---

<div class="post-metadata">

**Author:** ![the\_newb](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@the\_newb](https://forum.inductiveautomation.com/u/the_newb)\
**Post date:** [September 28, 2015, 3:56pm UTC](https://forum.inductiveautomation.com/t/dropdown-list/10533/4 "2015-09-28T15:56:45Z")

</div>

I must have worded my question in a way that made it misleading.

The problem was I wanted the scroll bar to start at the top when the dropdown list was opened.  
It was starting at the bottom. Turns out I had saved it in the designer with values in the ‘selected value’ section of the properties editor, so when I opened the list, it always went straight to that value.

Thanks for the feedback.
