# \[INCORRECT DOCS\] backwards docs on event.row and event.rowIndex 8.1.33

**URL:** <https://forum.inductiveautomation.com/t/incorrect-docs-backwards-docs-on-event-row-and-event-rowindex-8-1-33/81000>\
**Category:** General Discussion\
**Tags:** ignition81\
**Created:** [October 25, 2023, 10:26pm UTC](https://forum.inductiveautomation.com/t/incorrect-docs-backwards-docs-on-event-row-and-event-rowindex-8-1-33/81000 "2023-10-25T22:26:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cole\_Townsend](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cole_townsend/32/53149_2.png) [@Cole\_Townsend](https://forum.inductiveautomation.com/u/Cole_Townsend)\
**Post date:** [October 25, 2023, 10:26pm UTC](https://forum.inductiveautomation.com/t/incorrect-docs-backwards-docs-on-event-row-and-event-rowindex-8-1-33/81000/1 "2023-10-25T22:26:20Z")

</div>

Hey guys, I was messing with the table event configurations and I ran into some backwards documentation on the onRowClick event object. The row and RowIndex have flipped functionality as to what the docs say. the event.row object refers to the index of the filtered data, while the rowIndex refers to the index of all the rows in the table.

The docs have this mixed up.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/73dfec0e8dafb48acc2427c05b6499d1511e46f2.png)

---

<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 26, 2023, 5:12pm UTC](https://forum.inductiveautomation.com/t/incorrect-docs-backwards-docs-on-event-row-and-event-rowindex-8-1-33/81000/2 "2023-10-26T17:12:51Z")

</div>

> [@Cole\_Townsend](#):
>
> The row and RowIndex have flipped functionality as to what the docs say. the event.row object refers to the index of the filtered data, while the rowIndex refers to the index of all the rows in the table.

That's not how it's working on my end.  
I have this script:

```python
def runAction(self, event):
	from pprint import pformat
	system.perspective.print("click " + pformat(event))

```

And the default table, filtered like this:

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

As I click between rows this is what I get:

```auto
10:09:00.523 [Browser Thread: 1a28b64e-6d05-4713-9dcf-48ba145154f9] INFO Perspective.Designer.Workspace - click {u'row': 0L, u'rowIndex': 0L, u'value': {u'city': 'Folsom', u'country': 'United States', u'population': 77271L}}
10:09:03.799 [Browser Thread: 1a28b64e-6d05-4713-9dcf-48ba145154f9] INFO Perspective.Designer.Workspace - click {u'row': 1L, u'rowIndex': 1L, u'value': {u'city': 'Helsinki', u'country': 'Finland', u'population': 635591L}}
10:09:05.639 [Browser Thread: 1a28b64e-6d05-4713-9dcf-48ba145154f9] INFO Perspective.Designer.Workspace - click {u'row': 6L, u'rowIndex': 2L, u'value': {u'city': 'San Francisco', u'country': 'United States', u'population': 884363L}}
10:09:05.789 [Browser Thread: 1a28b64e-6d05-4713-9dcf-48ba145154f9] INFO Perspective.Designer.Workspace - click {u'row': 6L, u'rowIndex': 2L, u'value': {u'city': 'San Francisco', u'country': 'United States', u'population': 884363L}}
10:09:05.790 [Browser Thread: 1a28b64e-6d05-4713-9dcf-48ba145154f9] INFO Perspective.Designer.Workspace - dbl {u'row': 6L, u'rowIndex': 2L, u'value': {u'city': 'San Francisco', u'country': 'United States', u'population': 884363L}}
10:09:18.943 [Browser Thread: 1a28b64e-6d05-4713-9dcf-48ba145154f9] INFO Perspective.Designer.Workspace - click {u'row': 33L, u'rowIndex': 3L, u'value': {u'city': 'Kabul', u'country': 'Afghanistan', u'population': 3414100L}}
10:09:25.890 [Browser Thread: 1a28b64e-6d05-4713-9dcf-48ba145154f9] INFO Perspective.Designer.Workspace - click {u'row': 42L, u'rowIndex': 4L, u'value': {u'city': 'Paris', u'country': 'France', u'population': 2229621L}}
10:09:31.254 [Browser Thread: 1a28b64e-6d05-4713-9dcf-48ba145154f9] INFO Perspective.Designer.Workspace - click {u'row': 42L, u'rowIndex': 4L, u'value': {u'city': 'Paris', u'country': 'France', u'population': 2229621L}}
10:09:31.401 [Browser Thread: 1a28b64e-6d05-4713-9dcf-48ba145154f9] INFO Perspective.Designer.Workspace - dbl {u'row': 42L, u'rowIndex': 4L, u'value': {u'city': 'Paris', u'country': 'France', u'population': 2229621L}}
10:09:31.401 [Browser Thread: 1a28b64e-6d05-4713-9dcf-48ba145154f9] INFO Perspective.Designer.Workspace - click {u'row': 42L, u'rowIndex': 4L, u'value': {u'city': 'Paris', u'country': 'France', u'population': 2229621L}}

```

Where `rowIndex` is 'within the visible rows', and `row` is 'within the table's overall data', which is what the documentation (and the autocomplete) suggests:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/0/1027515168af4e1905dc9a1e9d08579d5ef4d1bf.png)

This is on 8.1.34, basically; are you on an older version? It's possible we fixed a bug here.

---

<div class="post-metadata">

**Author:** ![Cole\_Townsend](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cole_townsend/32/53149_2.png) [@Cole\_Townsend](https://forum.inductiveautomation.com/u/Cole_Townsend)\
**Post date:** [October 26, 2023, 5:41pm UTC](https://forum.inductiveautomation.com/t/incorrect-docs-backwards-docs-on-event-row-and-event-rowindex-8-1-33/81000/3 "2023-10-26T17:41:53Z")

</div>

Paul,

It's possible that I came to the wrong conclusion when it comes to a separate scripting function that has to do with the Table.

I was trying to use the .expandSubviews() function and I assumed (for whatever reason) that the function required the row index of the filtered table, and not the row index of the full table.

I'm not sure what made me think that, but that is where I went astray on this one. Looks like you pass the full table index to the expand and collapse functions.

Sorry for the confusion.

---

<div class="post-metadata">

**Author:** ![Cole\_Townsend](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cole_townsend/32/53149_2.png) [@Cole\_Townsend](https://forum.inductiveautomation.com/u/Cole_Townsend)\
**Post date:** [October 26, 2023, 5:43pm UTC](https://forum.inductiveautomation.com/t/incorrect-docs-backwards-docs-on-event-row-and-event-rowindex-8-1-33/81000/4 "2023-10-26T17:43:43Z")

</div>

I guess it was this comment that made me think that.

> [@Perspective Table - Expand Subview function](https://forum.inductiveautomation.com/t/perspective-table-expand-subview-function/34457/6):
>
> I was able to place this as part of the onRowClick Event of the Table: def runAction(self, event): self.expandSubviews([event.rowIndex]) it resulted in the Table expanding the subview for whichever row I clicked.

I'm not sure where to find the actual docs for that scripting function.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 26, 2023, 6:24pm UTC](https://forum.inductiveautomation.com/t/incorrect-docs-backwards-docs-on-event-row-and-event-rowindex-8-1-33/81000/5 "2023-10-26T18:24:49Z")

</div>

It's [here](https://docs.inductiveautomation.com/display/DOC81/Perspective+-+Table+Scripting#PerspectiveTableScripting-.expandSubviews()).
