# Perspective Drop Down Select Options

**URL:** <https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 12, 2023, 3:12pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909 "2023-06-12T15:12:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 12, 2023, 3:12pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909/1 "2023-06-12T15:12:25Z")

</div>

I am trying to use a database binding for my drop down but I am struggling having ingnition choose the 'correct' column as my options. My databases that I am binding it to select statement is:

select rank, concat(loc, ' ', qty)

the problem is that it is only using rank as the value and options. When I switch the order so that rank is after the concat in the select it uses rank as the option and the concat as the value. Ideally I would want the rank to order the dropdown, the concat as the option, and then another attribute as the value.

Is there any way that I can do this and specify which element in the query I to use in the drop down.

---

<div class="post-metadata">

**Author:** ![DNice](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@DNice](https://forum.inductiveautomation.com/u/DNice)\
**Post date:** [June 12, 2023, 3:17pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909/2 "2023-06-12T15:17:09Z")

</div>

I'd recommend adjusting your SQL statement to the following to get your desired outcome:

```auto
SELECT concat as label, [other col] as value
FROM (
    SELECT rank, concat(loc,'', qty) as concat, [other col]
    FROM...
    ORDER BY rank
) x

```

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 12, 2023, 3:18pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909/3 "2023-06-12T15:18:01Z")

</div>

```auto
select rank as value, concat(loc,'',qty) as label

```

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 12, 2023, 3:21pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909/4 "2023-06-12T15:21:11Z")

</div>

Thank you so much that worked perfectly!

select [other\_column] as value, concat as label  
from  
order by rank

a combination of the two was perfect thank you so much!

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 12, 2023, 3:23pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909/5 "2023-06-12T15:23:09Z")

</div>

One last unrelated question but is there a way to add a custom option to the database bind through a perspective method or is best way to just have a script

---

<div class="post-metadata">

**Author:** ![DNice](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@DNice](https://forum.inductiveautomation.com/u/DNice)\
**Post date:** [June 12, 2023, 3:24pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909/6 "2023-06-12T15:24:32Z")

</div>

> [@Ignition Perspective dropdown "allow custom options"](https://forum.inductiveautomation.com/t/ignition-perspective-dropdown-allow-custom-options/51787):
>
> Where can I find out more about the allowCustomOptions property for the perspective dropdown component? In the [documentation](https://docs.inductiveautomation.com/display/DOC80/Perspective+-+Dropdown), the only thing said about this is: Whether a user may enter a custom value to be submitted. Default is false. That doesn’t really tell me anything useful.

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 12, 2023, 3:26pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909/7 "2023-06-12T15:26:59Z")

</div>

So I know that it will be help but then add that custom to the binded database permanent would be best done through a script. Just don't want to be overlooking anything that ignition has made that makes this super simple.

---

<div class="post-metadata">

**Author:** ![DNice](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@DNice](https://forum.inductiveautomation.com/u/DNice)\
**Post date:** [June 12, 2023, 3:36pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909/8 "2023-06-12T15:36:50Z")

</div>

There is no built in INSERT functionality for adding to drop down database bindings as far as I know.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 12, 2023, 3:46pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909/9 "2023-06-12T15:46:19Z")

</div>

You would need a script transform on the binding to add another static option not included from the query like so

```auto
options = value.tolist()
options.append({"value":99,"label":"Help"})
return options 

```

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [June 12, 2023, 3:57pm UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-select-options/74909/10 "2023-06-12T15:57:48Z")

</div>

thank you so much will try this
