# DropDown data from Named Query, (String found, object expected)

**URL:** <https://forum.inductiveautomation.com/t/dropdown-data-from-named-query-string-found-object-expected/92946>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 9, 2024, 11:58am UTC](https://forum.inductiveautomation.com/t/dropdown-data-from-named-query-string-found-object-expected/92946 "2024-07-09T11:58:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [July 9, 2024, 11:58am UTC](https://forum.inductiveautomation.com/t/dropdown-data-from-named-query-string-found-object-expected/92946/1 "2024-07-09T11:58:04Z")

</div>

Hello!

For a dropdown I getting data from a Named Query and modify it so I just keep one column to show on the dropdown

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/787eca3ece4db52724c00363b5160a4c156db99a.png)

```python
def transform(self, value, quality, timestamp):

    # Convert the dataset to a Python list of dictionaries
    headers = value.getColumnNames()
    data = []
    
    for row in range(value.getRowCount()):
        row_dict = {headers[col]: value.getValueAt(row, col) for col in range(value.getColumnCount())}
        data.append(row_dict)
    
    # Extract the 'sedes' column from each row
    result = [row['sedes'] for row in data if 'sedes' in row]
    return result

```

But the dropdown is showing me this error message:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/3/9332b170516e12e887652f85961af55795d4656d.png)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/9/d97ef1840fbac43b426cad824312a05e9089af5c.png)

There is any workaround to solve this???

---

<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:** [July 9, 2024, 12:09pm UTC](https://forum.inductiveautomation.com/t/dropdown-data-from-named-query-string-found-object-expected/92946/2 "2024-07-09T12:09:31Z")

</div>

Your final output is a simple list of strings. It needs to be a list of dictionaries, each containing label and value keys.

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [July 9, 2024, 12:15pm UTC](https://forum.inductiveautomation.com/t/dropdown-data-from-named-query-string-found-object-expected/92946/3 "2024-07-09T12:15:38Z")

</div>

Yes, I just modify the query so it gives me just the column I needed. Thanks!
