# List of usernames in a dataset

**URL:** <https://forum.inductiveautomation.com/t/list-of-usernames-in-a-dataset/10471>\
**Category:** Ignition\
**Created:** [September 15, 2015, 4:15pm UTC](https://forum.inductiveautomation.com/t/list-of-usernames-in-a-dataset/10471 "2015-09-15T16:15:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Temple](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Matthew\_Temple](https://forum.inductiveautomation.com/u/Matthew_Temple)\
**Post date:** [September 15, 2015, 4:15pm UTC](https://forum.inductiveautomation.com/t/list-of-usernames-in-a-dataset/10471/1 "2015-09-15T16:15:54Z")

</div>

I’m trying to list all of the usernames in the internal profile into a table and / or drop down list. When I run the following code, I’m getting an error of “Row 0 doesn’t have the same number of columns as header list”.

[code]users = system.user.getUsers("")  
rows = []  
headers = [“user”]  
for user in users:  
oneRow = user.get(user.Username)  
rows.append(oneRow)

data = system.dataset.toDataSet(headers,rows)  
table = event.source.parent.getComponent(‘Table’)  
table.data = data[/code]

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [September 15, 2015, 5:03pm UTC](https://forum.inductiveautomation.com/t/list-of-usernames-in-a-dataset/10471/2 "2015-09-15T17:03:29Z")

</div>

Yep, it is because system.dataset.toDataSet expects a list of lists, not a list.  
This will work:

[code]users = system.user.getUsers("")  
rows = []  
headers = [“user”]  
for user in users:  
oneRow = user.get(user.Username)  
rows.append([oneRow])

data = system.dataset.toDataSet(headers,rows)  
table = event.source.parent.getComponent(‘Table’)  
table.data = data[/code]Best,
