# Dropdown list script

**URL:** <https://forum.inductiveautomation.com/t/dropdown-list-script/6886>\
**Category:** Archived Topics\
**Created:** [July 18, 2013, 3:25pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-script/6886 "2013-07-18T15:25:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kcl](https://avatars.discourse-cdn.com/v4/letter/k/a88e57/32.png) [@kcl](https://forum.inductiveautomation.com/u/kcl)\
**Post date:** [July 18, 2013, 3:25pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-script/6886/1 "2013-07-18T15:25:12Z")

</div>

Hi,  
I have the following script to populate a dropdown list:

def fillDropdown():  
import system  
data = []  
header = [“values”,“path”]

```
data.append([1,system.tag.read ('JellyBean/Rcp1')])
data.append([2,system.tag.read ('JellyBean/Rcp2')])
data.append([3,system.tag.read ('JellyBean/Rcp3')])
data.append([4,system.tag.read ('JellyBean/Rcp4')])
data.append([5,system.tag.read ('JellyBean/Rcp5')])
data.append([6,system.tag.read ('JellyBean/Rcp6')])

return system.dataset.toDataSet(header,data) 
system.dataset.toDataSet

```

It all works ok but on the list I get something like:

[“value of the tag1”,Good]  
[“value of the tag2”,Good]  
[“value of the tag3”,Good]  
…

How do I get rid of the “Good”? I just want to display the value of the tags in the list.  
I tried modifying the headers to just have the value but then I get an error about Row 0 not having the same number of columns as the header.  
Thanks

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 18, 2013, 3:37pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-script/6886/2 "2013-07-18T15:37:48Z")

</div>

system.tag.read returns a QualifiedValue object, and what you’re seeing is a string representation of that object showing its value and quality.

You can get the value alone out of a QualifiedValue by accessing the .value property.

```auto
data.append([1,system.tag.read('JellyBean/Rcp1').value])
```

---

<div class="post-metadata">

**Author:** ![kcl](https://avatars.discourse-cdn.com/v4/letter/k/a88e57/32.png) [@kcl](https://forum.inductiveautomation.com/u/kcl)\
**Post date:** [July 18, 2013, 3:48pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-script/6886/3 "2013-07-18T15:48:25Z")

</div>

Spot on. As usual.

Thanks

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 18, 2013, 4:05pm UTC](https://forum.inductiveautomation.com/t/dropdown-list-script/6886/4 "2013-07-18T16:05:54Z")

</div>

[quote=“kcl”]Spot on. As usual.

Thanks[/quote]

Glad I could help ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:")
