# Named query returns \[{Column:value}\] instead of just value

**URL:** <https://forum.inductiveautomation.com/t/named-query-returns-column-value-instead-of-just-value/79526>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 22, 2023, 7:32pm UTC](https://forum.inductiveautomation.com/t/named-query-returns-column-value-instead-of-just-value/79526 "2023-09-22T19:32:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kssp](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kssp](https://forum.inductiveautomation.com/u/kssp)\
**Post date:** [September 22, 2023, 7:32pm UTC](https://forum.inductiveautomation.com/t/named-query-returns-column-value-instead-of-just-value/79526/1 "2023-09-22T19:32:05Z")

</div>

Hey, folks.

I have an onActionPerformed running for a dropdown in Perspective. The options for this dropdown are filled via a query that pulls all values from one column in a table. The correct values populate into this dropdown.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/0/20823ea95eed1fda6e5cace765c7d8644eeebbd9.png)

After selecting an item from the dropdown, a named query checks the table for that selected value and returns the value from the correlated row's "Max" column into a text input field on the form. However, it does not return just the value. It is more of some sort of bracketed array?

Script for OnActionPerformed

```auto
def runAction(self, event):
	TemplateName = self.props.value
	self.getSibling("Maximum").props.text = system.db.runNamedQuery('qrySavedShopTemplate',{'TemplateName':TemplateName})

```

The named query above:

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

The result in the text field:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/58469e08ea2a19c0d7c1800c2ce349b1e3d9ff9f.png)

I'm not sure what I have screwed up here. Perhaps a data type is messed up? Thank you!

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [September 22, 2023, 7:34pm UTC](https://forum.inductiveautomation.com/t/named-query-returns-column-value-instead-of-just-value/79526/2 "2023-09-22T19:34:45Z")

</div>

If you're expecting just a value, set the query to "Scalar Query"

---

<div class="post-metadata">

**Author:** ![kssp](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kssp](https://forum.inductiveautomation.com/u/kssp)\
**Post date:** [September 22, 2023, 7:36pm UTC](https://forum.inductiveautomation.com/t/named-query-returns-column-value-instead-of-just-value/79526/3 "2023-09-22T19:36:25Z")

</div>

Ah, that worked all too well. Thank you. I'm still pretty new to this stuff, hahah.
