# Access user attributes from BasicUser object

**URL:** <https://forum.inductiveautomation.com/t/access-user-attributes-from-basicuser-object/84138>\
**Category:** Ignition\
**Tags:** perspective, scripting, ignition81\
**Created:** [January 11, 2024, 6:08pm UTC](https://forum.inductiveautomation.com/t/access-user-attributes-from-basicuser-object/84138 "2024-01-11T18:08:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Mambriani](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@Marco\_Mambriani](https://forum.inductiveautomation.com/u/Marco_Mambriani)\
**Post date:** [January 11, 2024, 6:08pm UTC](https://forum.inductiveautomation.com/t/access-user-attributes-from-basicuser-object/84138/1 "2024-01-11T18:08:23Z")

</div>

My goal is to show the list of users that belongs to a specific Roster.

I tried the following code but i got stuck and i don't know how to continue:

```auto
#Get the roster
roster = system.roster.getRoster(self.view.params.roster_name)
for user_ref in roster.getUsers():
   username = user_ref.get('username') 

```

it throws the following error:

```auto
TypeError: get(): 1st arg can't be coerced to com.inductiveautomation.ignition.common.config.Property

```

Here's some information i found:

- roster.getUsers() returns a list of BasicUser objects
- print(str(user\_ref)) =\> _{badge=null, schedule=Always, firstname=Luca, notes=null, language=it\_IT, user.pin=, username=Elettricista1, lastname=Rossi}_
- user\_ref.Username = username

What i expect is to find a way to retrieve this damn username.

Big thanks to anyone throwing some help my way!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 11, 2024, 6:25pm UTC](https://forum.inductiveautomation.com/t/access-user-attributes-from-basicuser-object/84138/2 "2024-01-11T18:25:04Z")

</div>

Try:  
`user_ref.get(user_ref.Username)`

---

<div class="post-metadata">

**Author:** ![Marco\_Mambriani](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@Marco\_Mambriani](https://forum.inductiveautomation.com/u/Marco_Mambriani)\
**Post date:** [January 12, 2024, 11:46am UTC](https://forum.inductiveautomation.com/t/access-user-attributes-from-basicuser-object/84138/3 "2024-01-12T11:46:32Z")

</div>

It works!  
Thank you very much Paul

---

<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:** [June 12, 2026, 5:18am UTC](https://forum.inductiveautomation.com/t/access-user-attributes-from-basicuser-object/84138/4 "2026-06-12T05:18:27Z")

</div>

> [@paul-griffith](#):
>
> user\_ref.get(user\_ref.Username)

I feel this should be mentioned in the user manual, as it took a relatively long time for me to give up hunting through, first the user manual, then the javadocs, trying _all sorts of things_, then eventually giving up and searching here to find this, which works, but it not obvious in the slightest (and I've used Ignition once or twice before)

---

<div class="post-metadata">

**Author:** ![tgarrison](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tgarrison/32/80965_2.png) [@tgarrison](https://forum.inductiveautomation.com/u/tgarrison)\
**Post date:** [June 12, 2026, 11:32am UTC](https://forum.inductiveautomation.com/t/access-user-attributes-from-basicuser-object/84138/5 "2026-06-12T11:32:01Z")

</div>

The whole user stuff is convoluted. Went thru the same bundle of fun trying to figure it out. Would be great to see some improved docs.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 12, 2026, 4:51pm UTC](https://forum.inductiveautomation.com/t/access-user-attributes-from-basicuser-object/84138/6 "2026-06-12T16:51:45Z")

</div>

FWIW, there is a "centralized" reference here:

> **[Users​ - Scripting Object Reference | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.3/appendix/reference-pages/scripting-object-reference#users)**
>
> The following sections describe the structure of some prominent objects returned or expected by Ignition system functions. Not all classes, fields, and methods are included in the lists below. For a fully comprehensive reference of all Ignition...

The whole situation is unnecessarily complicated by some legacy debt.  
If you have an explicitly wrapped `PyUser`, `user.get("username")` works - and all the `system.user` scripting functions _should_ return `PyUser` objects. But if you somehow end up with something that's not a PyUser, you have to do the awkward reference thing. And it wouldn't surprise me if there are code paths that don't properly hand back a PyUser still, because we're not doing that wrapping automatically.

One thing we could/should do is add constants, now that the hinting system supports them - at least then you'll have some autocomplete for our known attributes, so

```python
user = system.user.getUser("someuser")
username = user.get(system.user.Username)

```

Or something to that effect.
