# Dropdown list in vision

**URL:** <https://forum.inductiveautomation.com/t/dropdown-list-in-vision/73590>\
**Category:** Ignition\
**Tags:** ignition81, vision, database\
**Created:** [May 11, 2023, 1:31pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-in-vision/73590 "2023-05-11T13:31:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [May 11, 2023, 1:31pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-in-vision/73590/1 "2023-05-11T13:31:24Z")

</div>

Hi Guys,

I'm trying to in the dropdown list display text **"All Record"**. In below screenshot shows a list from the database correctly I'm trying to add "All Record" text in the first row but "All Record" is not available in database.

Any ideas on how to add "All Record" text in the dropdown list?

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/1/317194028633451988ae08d40210ebe8ed9174a3.png)

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [May 11, 2023, 1:39pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-in-vision/73590/2 "2023-05-11T13:39:45Z")

</div>

Maybe something like this:

```auto
SELECT '-1', 'All Record'
UNION
<existing query>

```

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [May 11, 2023, 1:44pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-in-vision/73590/3 "2023-05-11T13:44:37Z")

</div>

Found below error:

All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [May 11, 2023, 1:48pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-in-vision/73590/4 "2023-05-11T13:48:04Z")

</div>

Basically the first query must match the column count in your query.

Edit, do a quick Google, it will do a better job explaining than I can.

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [May 12, 2023, 5:45am UTC](https://forum.inductiveautomation.com/t/dropdown-list-in-vision/73590/5 "2023-05-12T05:45:49Z")

</div>

Hi Guys,

Resolved my problem using the following query but get output in order by my case "Exporting all formulas" This text always displays at the top.

```auto
SELECT 'Exporting all formulas' AS col1
UNION
SELECT Name AS col1 FROM Test

```

Any idea?

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [May 12, 2023, 5:59am UTC](https://forum.inductiveautomation.com/t/dropdown-list-in-vision/73590/6 "2023-05-12T05:59:41Z")

</div>

Resolved using following script:

```auto
headers = ['col1']
data = []
data.append(['Exporting all formulas'])
options = system.dataset.toDataSet(headers, data)
print options 
query = "Select Name from Test"
pyDataset = system.db.runPrepQuery(query)
normalDataset = system.dataset.toDataSet(pyDataset)
print normalDataset
appendDataset = system.dataset.appendDataset(options, normalDataset)
print appendDataset
event.source.data = appendDataset

```
