# Row 0 doesn't have the same number of columns as header list error

**URL:** <https://forum.inductiveautomation.com/t/row-0-doesnt-have-the-same-number-of-columns-as-header-list-error/43527>\
**Category:** Ignition\
**Created:** [February 17, 2021, 5:38pm UTC](https://forum.inductiveautomation.com/t/row-0-doesnt-have-the-same-number-of-columns-as-header-list-error/43527 "2021-02-17T17:38:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasath.t](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@prasath.t](https://forum.inductiveautomation.com/u/prasath.t)\
**Post date:** [February 17, 2021, 5:38pm UTC](https://forum.inductiveautomation.com/t/row-0-doesnt-have-the-same-number-of-columns-as-header-list-error/43527/1 "2021-02-17T17:38:26Z")

</div>

![Stacked bar](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/620ac10443cfb76a9f1d32fe1862dee762609905.png)

when i run the above script i am getting this error  
**Row 0 doesn’t have the same number of columns as header list.**  
can any one help me out on this

---

<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:** [February 17, 2021, 5:52pm UTC](https://forum.inductiveautomation.com/t/row-0-doesnt-have-the-same-number-of-columns-as-header-list-error/43527/2 "2021-02-17T17:52:01Z")

</div>

Instead of a screenshot, could you paste the code here? Also, what version of Ignition are you using?

---

<div class="post-metadata">

**Author:** ![osolorzano](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/osolorzano/32/6432_2.png) [@osolorzano](https://forum.inductiveautomation.com/u/osolorzano)\
**Post date:** [February 17, 2021, 7:06pm UTC](https://forum.inductiveautomation.com/t/row-0-doesnt-have-the-same-number-of-columns-as-header-list-error/43527/3 "2021-02-17T19:06:06Z")

</div>

~~In your code, data only has one element which is the array you appended in line 9. You need to append x1-x5 in their own append statements.~~  
~~Alternatively, I think it would work if you use `.extend()` instead of `.append()` on line 9.~~  
@Paullys50 is correct. Not sure what I was thinking. Like he said you should try validating the tag reads or use system.tag.readBlocking()

---

<div class="post-metadata">

**Author:** ![Paullys50](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paullys50/32/3324_2.png) [@Paullys50](https://forum.inductiveautomation.com/u/Paullys50)\
**Post date:** [February 17, 2021, 8:48pm UTC](https://forum.inductiveautomation.com/t/row-0-doesnt-have-the-same-number-of-columns-as-header-list-error/43527/4 "2021-02-17T20:48:06Z")

</div>

> [@osolorzano](#):
>
> You need to append x1-x5 in their own append statements.

OP's syntax is acceptable.

```auto
headers = ["Label", "Compressor", "Line", "Services", "SPA"]
data = []
x2 = 2
x3 = 3
x4 = 4
x5 = 5
data.append(["workshop", x2, x3, x4, x5])

event_perform = system.dataset.toDataSet(headers, data)
print event_perform

```

One or more of the system.tag.read calls is likely returning an empty or invalid value that is causing the conflict. Easy to verify if you comment out the reads and replace with a value per my example. If I'm correct you will need to validate the x2-x5 values after the read but prior to adding them to the data array so they are initialized with some default should the tag read result not provide good data.

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [May 12, 2023, 5:53am UTC](https://forum.inductiveautomation.com/t/row-0-doesnt-have-the-same-number-of-columns-as-header-list-error/43527/6 "2023-05-12T05:53:22Z")

</div>

@Paullys50 Thanks this post was very helpful to me.
