# List component with Ignition User names

**URL:** <https://forum.inductiveautomation.com/t/list-component-with-ignition-user-names/12318>\
**Category:** Ignition\
**Created:** [November 2, 2016, 10:48am UTC](https://forum.inductiveautomation.com/t/list-component-with-ignition-user-names/12318 "2016-11-02T10:48:10Z")\
**Posts on this page:** 3\
**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:** [November 2, 2016, 10:48am UTC](https://forum.inductiveautomation.com/t/list-component-with-ignition-user-names/12318/1 "2016-11-02T10:48:10Z")

</div>

Hi,

I’m trying to populate a List component with all Ignition users that have a particular role.

For a bit of context, the list will contain a list of all ‘wine maker’ users. Selecting one or multiple wine makers will then filter a list of tanks (template repeater) to show only tanks assigned to those selected wine makers. I can easily achieve this by either using a static dataset or querying a SQL table, but I’d like to be able to link it to Ignition users instead.

I can see that I could do this using Python (system.users.getUsers("")), however I don’t know how to populate the list dataset via a python script. Is this possible?

---

<div class="post-metadata">

**Author:** ![scicco](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@scicco](https://forum.inductiveautomation.com/u/scicco)\
**Post date:** [November 2, 2016, 12:58pm UTC](https://forum.inductiveautomation.com/t/list-component-with-ignition-user-names/12318/2 "2016-11-02T12:58:57Z")

</div>

Hello,

You could add something like this to your internalFrameActivated event:

[code]headers = [“User Name”]  
data = []

users = system.user.getUsers("")  
for user in users:   
roles = user.getRoles()  
for role in roles:  
if role == “wine maker”:   
data.append([user.get(user.Username)])

user\_dataset = system.dataset.toDataSet(headers, data)

system.gui.getParentWindow(event).getComponentForPath(‘Root Container.List’).data = user\_dataset[/code]

---

<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:** [November 7, 2016, 7:03am UTC](https://forum.inductiveautomation.com/t/list-component-with-ignition-user-names/12318/3 "2016-11-07T07:03:00Z")

</div>

Thanks! This works great.
