# Binding flex repeater values to columns of a named query

**URL:** <https://forum.inductiveautomation.com/t/binding-flex-repeater-values-to-columns-of-a-named-query/100375>\
**Category:** Ignition\
**Created:** [January 2, 2025, 6:03am UTC](https://forum.inductiveautomation.com/t/binding-flex-repeater-values-to-columns-of-a-named-query/100375 "2025-01-02T06:03:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thanya\_Gangesh](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@Thanya\_Gangesh](https://forum.inductiveautomation.com/u/Thanya_Gangesh)\
**Post date:** [January 2, 2025, 6:03am UTC](https://forum.inductiveautomation.com/t/binding-flex-repeater-values-to-columns-of-a-named-query/100375/1 "2025-01-02T06:03:20Z")

</div>

In Ignition designer, I have a named query with 3 columns and each column has only 1 entry/row with a numeric value. How do I bind a label present in a flex repeater to each column such that the label shows the number in whichever column is bound to it?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 2, 2025, 9:20am UTC](https://forum.inductiveautomation.com/t/binding-flex-repeater-values-to-columns-of-a-named-query/100375/2 "2025-01-02T09:20:40Z")

</div>

If there's only one row, you should be able to grab the first row with a subscript (`[0]`) then loop through that row to extract the columns.  
Try this:

```python
instances_data = [
	{
		'param': val
	} for val in system.db.runNamedQuery(your_named_query)[0]
]

```

Change `'param'` to whatever is your instances parameter name.

This should work with any number of columns.  
If there's a chance the query doesn't return any data, you'll have add a check. Something like this:

```python
data = system.db.runQuery(q)
if data.rowCount > 0:
	instances_data = [
		{
			'value': x
		} for x in data[0]
	]

```

---

<div class="post-metadata">

**Author:** ![Thanya\_Gangesh](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@Thanya\_Gangesh](https://forum.inductiveautomation.com/u/Thanya_Gangesh)\
**Post date:** [January 2, 2025, 9:40am UTC](https://forum.inductiveautomation.com/t/binding-flex-repeater-values-to-columns-of-a-named-query/100375/3 "2025-01-02T09:40:33Z")

</div>

Got it. Thank you!
