# Dropdown component shows values, not labels

**URL:** <https://forum.inductiveautomation.com/t/dropdown-component-shows-values-not-labels/67688>\
**Category:** Ignition\
**Tags:** perspective, vision, ignition81\
**Created:** [December 15, 2022, 6:32pm UTC](https://forum.inductiveautomation.com/t/dropdown-component-shows-values-not-labels/67688 "2022-12-15T18:32:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwb](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@dwb](https://forum.inductiveautomation.com/u/dwb)\
**Post date:** [December 15, 2022, 6:32pm UTC](https://forum.inductiveautomation.com/t/dropdown-component-shows-values-not-labels/67688/1 "2022-12-15T18:32:18Z")

</div>

Hi,  
I have a dropdown component which has a query as the binding type. The return format is set to auto.  
This is my named query:

```auto
SELECT 0, '<Select One>'
UNION
SELECT IssueId, IssueName FROM vwIssueToPrint

```

This query is working well, I can see that it creates a table 6x2. Everything seems to be fine. But the problem is that the dropdown is not showing the labels, which are in the column 2, but it's showing the values in the column 1.  
I have this same project in vision, using this same query, and there it works fine. But in perspective I have this issue.  
What could be the reason for this?  
Thanks.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 15, 2022, 7:36pm UTC](https://forum.inductiveautomation.com/t/dropdown-component-shows-values-not-labels/67688/2 "2022-12-15T19:36:36Z")

</div>

Perspective doesn't use two columns. I recommend you bind that dataset to custom property (to maintain correspondance between IssueId and IssueName), then bind the dropdown's options to the dataset property with a transform that delivers just the names.

Or possibly just reverse the column order.

---

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [December 15, 2022, 7:47pm UTC](https://forum.inductiveautomation.com/t/dropdown-component-shows-values-not-labels/67688/3 "2022-12-15T19:47:23Z")

</div>

Try something like the below, cant test it as I don't have your DB but works in my project (with my table names)

```auto
Select '0' as 'value', '<Select One>' as 'label'
Union All
SELECT IssueId as 'value', IssueName as 'label'
FROM vwIssueToPrint
ORDER BY label

```

Edited to say you will need to change the ORDER BY to `ORDER BY label` I corrected the above.

---

<div class="post-metadata">

**Author:** ![dwb](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@dwb](https://forum.inductiveautomation.com/u/dwb)\
**Post date:** [December 15, 2022, 8:12pm UTC](https://forum.inductiveautomation.com/t/dropdown-component-shows-values-not-labels/67688/4 "2022-12-15T20:12:42Z")

</div>

Thank you for your answers.  
This script really works:

```auto
Select '0' as 'value', '<Select One>' as 'label'
Union All
SELECT IssueId as 'value', IssueName as 'label' FROM vwIssueToPrint
ORDER BY label

```

Thanks again.
