# Reading Datasets, getRowIndex

**URL:** <https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801>\
**Category:** Ignition\
**Created:** [January 13, 2025, 3:23pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801 "2025-01-13T15:23:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Platt](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jason\_Platt](https://forum.inductiveautomation.com/u/Jason_Platt)\
**Post date:** [January 13, 2025, 3:23pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/1 "2025-01-13T15:23:41Z")

</div>

Hey Ignition Community

trying to find a way to get the row index if I know the value of a specific column.

Example, column 0 is a sequence number, the column 1-15 are the instructions for that specific sequence. I know I'm on sequence 100, but I don't know that its in row 0. Is there any way to get that value of 0?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 13, 2025, 3:27pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/2 "2025-01-13T15:27:26Z")

</div>

Can you post an example dataset?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [January 13, 2025, 3:29pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/3 "2025-01-13T15:29:20Z")

</div>

Well, the short answer is "it depends".

Datasets are not necessarily ordered, and this almost always extends back to the data source. There are many techniques that could be used to find what row a cell in a particular column has a certain value, but unless you have otherwise enforced it, there is nothing that guarantees that value to be unique.

My first question would be how are you trying to access this data such that you know the value at a row and column, but you do not know the row number?

---

<div class="post-metadata">

**Author:** ![Jason\_Platt](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jason\_Platt](https://forum.inductiveautomation.com/u/Jason_Platt)\
**Post date:** [January 13, 2025, 3:29pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/4 "2025-01-13T15:29:33Z")

</div>

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

---

<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:** [January 13, 2025, 3:33pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/5 "2025-01-13T15:33:59Z")

</div>

In a binding, I would generally use my [where()](https://www.automation-pros.com/toolkit/doc/iteration.html#where) expression function to spit out the matching row. (In my Integration Toolkit.)

---

<div class="post-metadata">

**Author:** ![Jason\_Platt](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jason\_Platt](https://forum.inductiveautomation.com/u/Jason_Platt)\
**Post date:** [January 13, 2025, 3:39pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/6 "2025-01-13T15:39:18Z")

</div>

process engineering gives me a task list in excel, I would then populate a dataset off that file. The Sequence number is kinda like a primary key for SQL. The Seq number would be updated by the PLC, then I would populate a UDT with all the data that would be corresponding to that seq number

---

<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:** [January 13, 2025, 3:40pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/7 "2025-01-13T15:40:14Z")

</div>

Is there a reason you can't just use SQL?

---

<div class="post-metadata">

**Author:** ![Jason\_Platt](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jason\_Platt](https://forum.inductiveautomation.com/u/Jason_Platt)\
**Post date:** [January 13, 2025, 3:41pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/8 "2025-01-13T15:41:02Z")

</div>

IT, dont have a DB and am very restricted on getting one made

---

<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:** [January 13, 2025, 3:43pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/9 "2025-01-13T15:43:46Z")

</div>

> [@Jason\_Platt](#):
>
> very restricted

Oy! Then you **really** need my toolkit.

Ignition without a DB is like using paper cups with string instead of telephones and networks.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 13, 2025, 3:44pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/10 "2025-01-13T15:44:26Z")

</div>

Using Ignition without a database is like buying a Ferrari but not wanting to put tires on it.

---

<div class="post-metadata">

**Author:** ![Jason\_Platt](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jason\_Platt](https://forum.inductiveautomation.com/u/Jason_Platt)\
**Post date:** [January 13, 2025, 3:45pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/11 "2025-01-13T15:45:13Z")

</div>

I have some "Standard" DBs that they created. Useful but not flexible on making new tables. If this idea fails then I would go down the route of forcing them to make me a new table

---

<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:** [January 13, 2025, 3:46pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/12 "2025-01-13T15:46:12Z")

</div>

Are you forbidden to use the designer's query browser to make a table?

---

<div class="post-metadata">

**Author:** ![Jason\_Platt](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jason\_Platt](https://forum.inductiveautomation.com/u/Jason_Platt)\
**Post date:** [January 13, 2025, 3:47pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/13 "2025-01-13T15:47:19Z")

</div>

mostly likely not, might have to give that a try and hope they don't notice

---

<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:** [January 13, 2025, 3:49pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/14 "2025-01-13T15:49:44Z")

</div>

> [@Jason\_Platt](#):
>
> hope they don't notice

Their policy might be hiding the fact that they don't really know what they are doing. In which case your actions are unlikely to be noticed. Developing in Ignition without DBA privileges is like being handcuffed.

---

<div class="post-metadata">

**Author:** ![Jason\_Platt](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jason\_Platt](https://forum.inductiveautomation.com/u/Jason_Platt)\
**Post date:** [January 13, 2025, 3:55pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/15 "2025-01-13T15:55:45Z")

</div>

man you're telling me. I'm a controls guy who's not allowed to have admin right on my local.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [January 13, 2025, 3:57pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/16 "2025-01-13T15:57:05Z")

</div>

I assume that you're using:

`system.dataset.fromCSV()` to create a dataset from the file you're given?

If that is so, then you could do something like this:

```python
data = system.dataset.toPyDatSet(excelDataset)
seqNum = 100
rowIndex = 0
for i,v in enumerate(data.getColumnAsList(data.getColumnIndex('SeqNum'))):
    if v = seqNum:
        rowIndex = i
        break

print data[rowIndex]

```

It goes without being said, that a DB will make this much much easier and is the preferred method. Especially considering that you mention that you want to then push these values out into a UDT. I would strongly recommend that you do any scripting like this in a Gateway Event Script.

> [@Jason\_Platt](#):
>
> man you're telling me. I'm a controls guy who's not allowed to have admin right on my local.

This used to be the same with me, didn't take long for them to get tired of me calling them just to log in and watch me correct the issue. But if they hadn't yielded, I would have been gone a long time ago.

---

<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:** [January 13, 2025, 3:57pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/17 "2025-01-13T15:57:06Z")

</div>

> [@Jason\_Platt](#):
>
> not allowed to have admin right on my local.

I'd quit that job so fast it'd make their heads spin.

It's probably just as well that I'm solo and do my own IT.

---

<div class="post-metadata">

**Author:** ![Jason\_Platt](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jason\_Platt](https://forum.inductiveautomation.com/u/Jason_Platt)\
**Post date:** [January 13, 2025, 4:26pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/18 "2025-01-13T16:26:25Z")

</div>

just getting total number of rows

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/a/4ac4bcba0fe5f7fffa2e24b1004f80e1dd65252e.png)

---

<div class="post-metadata">

**Author:** ![Jason\_Platt](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@Jason\_Platt](https://forum.inductiveautomation.com/u/Jason_Platt)\
**Post date:** [January 13, 2025, 4:26pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/19 "2025-01-13T16:26:53Z")

</div>

I would if the benefits and it wasn't a 5 minute commute

---

<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:** [January 13, 2025, 4:44pm UTC](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801/20 "2025-01-13T16:44:48Z")

</div>

> [@Jason\_Platt](#):
>
> just getting total number of rows

That's the normal printed representation of a row object.

[Next page](https://forum.inductiveautomation.com/t/reading-datasets-getrowindex/100801.md?page=2)
