# Grabbing the index of a table

**URL:** <https://forum.inductiveautomation.com/t/grabbing-the-index-of-a-table/7307>\
**Category:** Ignition\
**Created:** [September 24, 2013, 2:01am UTC](https://forum.inductiveautomation.com/t/grabbing-the-index-of-a-table/7307 "2013-09-24T02:01:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuartd](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@stuartd](https://forum.inductiveautomation.com/u/stuartd)\
**Post date:** [September 24, 2013, 2:01am UTC](https://forum.inductiveautomation.com/t/grabbing-the-index-of-a-table/7307/1 "2013-09-24T02:01:07Z")

</div>

So this might be super trivial or something I am not sure. What I am trying to do, at least I think it should, is fairly simple.

I have three tables, one is showing a master list of everything, the other two tables show Parent or Child relationships between those on the master list. I want to set up a system where if it is selected on the child/parent tables it will deselect everything and select the child/parent on the master list. I need a way to scan through the master list to grab the index where it equal what the child/parent ID was.

Any ideas on how to do this?

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [September 24, 2013, 3:21pm UTC](https://forum.inductiveautomation.com/t/grabbing-the-index-of-a-table/7307/2 "2013-09-24T15:21:17Z")

</div>

Well, you can use the data.getValueAt(row, col) function to check what the value is in any given row.

---

<div class="post-metadata">

**Author:** ![stuartd](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@stuartd](https://forum.inductiveautomation.com/u/stuartd)\
**Post date:** [September 24, 2013, 3:45pm UTC](https://forum.inductiveautomation.com/t/grabbing-the-index-of-a-table/7307/3 "2013-09-24T15:45:38Z")

</div>

Will that grab me the index? if I go, data.getValueAt(row, “Index”)

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [September 24, 2013, 3:56pm UTC](https://forum.inductiveautomation.com/t/grabbing-the-index-of-a-table/7307/4 "2013-09-24T15:56:27Z")

</div>

Yeah, that’s right. Assuming you have a column named Index. There’s more about it in the [user manual](http://www.inductiveautomation.com/support/usermanuals/ignition/working_with_different_datatyp.htm).

---

<div class="post-metadata">

**Author:** ![stuartd](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@stuartd](https://forum.inductiveautomation.com/u/stuartd)\
**Post date:** [September 24, 2013, 4:03pm UTC](https://forum.inductiveautomation.com/t/grabbing-the-index-of-a-table/7307/5 "2013-09-24T16:03:49Z")

</div>

I don’t. In the picture it shows the layout. I want to double click on a parent or child. and have it set that to be the selected row in the top. So I have to reset the column selector, that isn’t hard to do. From there I need to take the DocumentID, which is a column, and go through the master list and find the index of that DocumentID. From there I can set the selected row of the master list to the index. I am having a problem finding the index part.

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [September 24, 2013, 4:20pm UTC](https://forum.inductiveautomation.com/t/grabbing-the-index-of-a-table/7307/6 "2013-09-24T16:20:28Z")

</div>

I’m not sure what you mean by ‘index’. If that is not a column in your table, then what is it?
