# Power table Selected Cell value Expression - Question

**URL:** <https://forum.inductiveautomation.com/t/power-table-selected-cell-value-expression-question/23672>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [March 27, 2019, 10:58pm UTC](https://forum.inductiveautomation.com/t/power-table-selected-cell-value-expression-question/23672 "2019-03-27T22:58:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulm1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulm1/32/5900_2.png) [@paulm1](https://forum.inductiveautomation.com/u/paulm1)\
**Post date:** [March 27, 2019, 10:58pm UTC](https://forum.inductiveautomation.com/t/power-table-selected-cell-value-expression-question/23672/1 "2019-03-27T22:58:23Z")

</div>

I have a Standard Table Component(Table1)that is displaying values associated with operator request.  
I also have a Power Table Component(PwrTable2) on the same screen that is populated based on the selected row from Table1. PwrTable2 gets its Dataset from the following Query.

```
SELECT * FROM maint WHERE id LIKE {Root Container.SelectedCell}

```

Root Container.SelectedCell is a Custom Property.  
This works well, as long as a row is selected on Table1, otherwise I get the following Error.

Exception: Error executing expression binding on  
Batching.Root Container.SelectedCell  
caused by ArrayIndexOutOfBoundsException: -1

What can i do to resolve this error?

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [March 28, 2019, 1:05pm UTC](https://forum.inductiveautomation.com/t/power-table-selected-cell-value-expression-question/23672/2 "2019-03-28T13:05:13Z")

</div>

I would populate PwrTable2 by either by a propertyChange script on Table1. That way you can also put in an alternate case if there isn’t a row selected.

Either that or on your RootContainer.SelectedCell binding, make it so that it has an expression where if it is -1 substitute a different value that makes sense for your system.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [March 28, 2019, 1:38pm UTC](https://forum.inductiveautomation.com/t/power-table-selected-cell-value-expression-question/23672/3 "2019-03-28T13:38:24Z")

</div>

You can easily wrap your expression in a [`try`](https://docs.inductiveautomation.com/display/DOC79/try) function to supply a default value.

---

<div class="post-metadata">

**Author:** ![paulm1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulm1/32/5900_2.png) [@paulm1](https://forum.inductiveautomation.com/u/paulm1)\
**Post date:** [April 1, 2019, 4:53pm UTC](https://forum.inductiveautomation.com/t/power-table-selected-cell-value-expression-question/23672/4 "2019-04-01T16:53:04Z")

</div>

Thank you for you help, grietveld and Sandered17.  
Considering my existing expressions, Sanderd17’s solution was the easiest to implement .

Again, Thank you both for your help.
