# Table row/column data into label

**URL:** <https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [February 17, 2025, 7:23pm UTC](https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444 "2025-02-17T19:23:14Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [February 17, 2025, 7:23pm UTC](https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444/1 "2025-02-17T19:23:14Z")

</div>

OK, so I am wanting to pull the top 3 rows of data of a certain column/row into separate labels. Youll see here that the top 3 rows have values of 53,51,30 in the ASRS Buggy Count column.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/3/53dde7b0174758a3aff593644ad3e4a4f9489171.png)  
I have this table being sorted by that column to show descending.  
When I try this on a label of the table, I am returning the tag query value of row 1 instead of the sorted value.

```python
{../Table_ASRS.props.data}[5]

```

The label returns a value of 7.

How can I have that label show whats been sorted without having to rewrite the table query?

---

<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:** [February 17, 2025, 7:29pm UTC](https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444/2 "2025-02-17T19:29:40Z")

</div>

`props.data` is what you **deliver** to the table. What sorting and/or filtering you perform in the browser isn't changing that. What you select should be return to you (back to the gateway) in `props.selection.data`. ~~Without selection, the filtered/sorted dataset is not returned to the gateway at all.~~

Look at `props.filter.results.data` after setting `props.filter.results.enabled` true. Note the warning in the manual if you do this.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 17, 2025, 7:31pm UTC](https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444/3 "2025-02-17T19:31:33Z")

</div>

> [@mjohnson0238](#):
>
> ... without having to rewrite the table query?

The easiest way is to do just that. Add  
`ORDER BY [ASRS Buggy Count] DESC`  
into your default query. Then the user can sort whatever way they like but the top three will still show up in the label.

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [February 17, 2025, 7:37pm UTC](https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444/4 "2025-02-17T19:37:15Z")

</div>

OK, another question can I default the data to always select 3 or no?

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

---

<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:** [February 17, 2025, 7:38pm UTC](https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444/5 "2025-02-17T19:38:09Z")

</div>

> [@mjohnson0238](#):
>
> no

No. Row selection beyond a single row can only happen from the browser.

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [February 17, 2025, 7:57pm UTC](https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444/6 "2025-02-17T19:57:51Z")

</div>

Alright. Can I pick which row to return from the table, without it being selected?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [February 17, 2025, 8:01pm UTC](https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444/7 "2025-02-17T20:01:15Z")

</div>

> [@mjohnson0238](#):
>
> Can I pick which row to return from the table, without it being selected?

Sure, what criteria would you use? Wouldn't it make more since just to write another query that does the filtering that you want at this point?

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [February 17, 2025, 8:02pm UTC](https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444/8 "2025-02-17T20:02:07Z")

</div>

yeah, I suppose so. Ill just do that.

---

<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:** [February 17, 2025, 8:09pm UTC](https://forum.inductiveautomation.com/t/table-row-column-data-into-label/102444/9 "2025-02-17T20:09:31Z")

</div>

If you are using my Integration Toolkit, you can save a bit on the DB side by running your raw `props.data` through my `orderBy()` expression function. Perhaps wrapped with my `where()` function to give you just the top three.
