# Script syntax- get length of dataset

**URL:** <https://forum.inductiveautomation.com/t/script-syntax-get-length-of-dataset/42615>\
**Category:** Ignition\
**Created:** [January 26, 2021, 3:45pm UTC](https://forum.inductiveautomation.com/t/script-syntax-get-length-of-dataset/42615 "2021-01-26T15:45:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rusty](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rusty/32/19859_2.png) [@Rusty](https://forum.inductiveautomation.com/u/Rusty)\
**Post date:** [January 26, 2021, 3:45pm UTC](https://forum.inductiveautomation.com/t/script-syntax-get-length-of-dataset/42615/1 "2021-01-26T15:45:48Z")

</div>

Hello,

I’m trying to make a simple for loop with the range equivalent of the number of rows in a dataset. I can’t seem to get the syntax correct. This is what I’ve tried so far:

```auto
DataSetTag = '[default]Folder/Tag1`

for x in range(len(system.tag.read(DataSetTag))):
	print x

for x in range(len(system.tag.read(DataSetTag).value)):
	print x

for x in range(data.getRowCount(DataSetTag)):
	print x

```

I assume this is really simple to solve, any help is appreciated.

Thank you

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [January 26, 2021, 3:51pm UTC](https://forum.inductiveautomation.com/t/script-syntax-get-length-of-dataset/42615/2 "2021-01-26T15:51:36Z")

</div>

`print system.tag.read(DataSetTag).value.getRowCount()`
