# Table event handlers - event.column "int & str" return type? + How to get edited column index?

**URL:** <https://forum.inductiveautomation.com/t/table-event-handlers-event-column-int-str-return-type-how-to-get-edited-column-index/63960>\
**Category:** Ignition\
**Created:** [September 12, 2022, 7:43am UTC](https://forum.inductiveautomation.com/t/table-event-handlers-event-column-int-str-return-type-how-to-get-edited-column-index/63960 "2022-09-12T07:43:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 12, 2022, 7:43am UTC](https://forum.inductiveautomation.com/t/table-event-handlers-event-column-int-str-return-type-how-to-get-edited-column-index/63960/1 "2022-09-12T07:43:29Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/6/0650b072f4ebe1ffc7d8d8ece4df0dcd44ea689e.png)

I need to know the column index so that I can use the index to update the underlying table, but the `event.column` return type, according to the info in the intelli popup, is an “int & str”. Not sure what that means?  
What it _actually_ is returning, is the column _name_ as a str. Is there a simple way to get the int index to use with `table.setValueAt`, or am I going to have to use something dumb like  
`system.dataset.getColumnHeaders(ds)`, loop through it and find the index of the header that way?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [September 12, 2022, 9:22am UTC](https://forum.inductiveautomation.com/t/table-event-handlers-event-column-int-str-return-type-how-to-get-edited-column-index/63960/2 "2022-09-12T09:22:06Z")

</div>

you can use both colName or colIndex to set value in a dataset

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

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 12, 2022, 12:28pm UTC](https://forum.inductiveautomation.com/t/table-event-handlers-event-column-int-str-return-type-how-to-get-edited-column-index/63960/3 "2022-09-12T12:28:14Z")

</div>

That makes more sense. I was looking at the api instead of the user manual 🙄 cheers

---

<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:** [September 12, 2022, 12:32pm UTC](https://forum.inductiveautomation.com/t/table-event-handlers-event-column-int-str-return-type-how-to-get-edited-column-index/63960/4 "2022-09-12T12:32:44Z")

</div>

Datasets also have a `getColumnIndex()` method.

---

<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:** [September 12, 2022, 3:46pm UTC](https://forum.inductiveautomation.com/t/table-event-handlers-event-column-int-str-return-type-how-to-get-edited-column-index/63960/5 "2022-09-12T15:46:34Z")

</div>

Note that internally, everything is using the index. So `setValue` using the column name _is_ going to do a linear scan of the column names looking for a match. In practice, given how many columns a typical dataset has, this isn’t really a performance problem.
