# Way to get a whole row of a dataset via an expression?

**URL:** <https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [October 4, 2021, 2:51pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577 "2021-10-04T14:51:23Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [October 4, 2021, 2:51pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/1 "2021-10-04T14:51:23Z")

</div>

I know you can get a row/column value from a dataset by doing something like `try({Root Container.Data}[row, 'columnName], -1)`. Is there a way to get the full row from a dataset into another dataset property?

I inherited a screen with 160 templates, and each feeds a full copy of a root container custom dataset into its template, where that dataset is then parsed… its slow as you might imagine. I was wondering if there was a way I could only give the template the appropriate row to parse out?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [October 4, 2021, 2:58pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/2 "2021-10-04T14:58:57Z")

</div>

Maybe via a script in a custom method, then use runScript in the expression.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [October 4, 2021, 3:00pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/3 "2021-10-04T15:00:17Z")

</div>

Good point, I was more specifically wondering if there was a pure built in way but good to remember I always have that option.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 4, 2021, 4:07pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/4 "2021-10-04T16:07:40Z")

</div>

This isn’t possible directly through expressions, but I do have to wonder if it’s actually the slow part of the equation; it’s (unfortunately) hard to benchmark Vision but you might be surprised where the actual slowdowns are.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [October 4, 2021, 4:10pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/5 "2021-10-04T16:10:47Z")

</div>

It could be a number of issues tbh, this project is shall we say, not optimized.

The whole template needs to be duplicated and changed up a bit due to some database changes for some items, so I don’t think I need answer anymore.

I don’t know if I should delete the question, or leave it up in case someone else searches for the answer to this.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 4, 2021, 4:12pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/6 "2021-10-04T16:12:49Z")

</div>

Nah, leave it up. Never hurts.

I was actually hoping to add this functionality when I reworked expressions to be ‘aware’ of Java arrays and lists, but unfortunately the dataset ‘subscript’ already assumes you mean ‘the first row’ if you just ask for a specific column `{dataset}["myColumn"]`, so it’s impossible to do and maintain backwards compatibility.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 5, 2021, 11:12am UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/7 "2021-10-05T11:12:14Z")

</div>

Would a lookup expression be better to use here?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [October 5, 2021, 12:10pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/8 "2021-10-05T12:10:49Z")

</div>

How? I thought `lookup` is related to one column and comparing a value.

---

<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:** [October 5, 2021, 12:20pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/9 "2021-10-05T12:20:57Z")

</div>

```auto
view("Select * Where _r = args[0]", {Root Container.path.to.dataset}, {Root Container.path.to.rowIndex})

```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 5, 2021, 1:23pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/10 "2021-10-05T13:23:46Z")

</div>

> [@jlandwerlen](#):
>
> How? I thought `lookup` is related to one column and comparing a value.

Generally speaking, your dataset should have a unique-value column. The lookup value becomes a parameter in the template. It's no different than {dataset}[row, col], except you can lookup the row.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [October 5, 2021, 1:25pm UTC](https://forum.inductiveautomation.com/t/way-to-get-a-whole-row-of-a-dataset-via-an-expression/51577/11 "2021-10-05T13:25:16Z")

</div>

Ok, you weren’t suggesting to use it to get an entire row, but to use in the template itself. I misunderstood.
