# Username property of User Object not returning username

**URL:** <https://forum.inductiveautomation.com/t/username-property-of-user-object-not-returning-username/72751>\
**Category:** Ignition\
**Created:** [April 21, 2023, 7:54am UTC](https://forum.inductiveautomation.com/t/username-property-of-user-object-not-returning-username/72751 "2023-04-21T07:54:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![liam1](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@liam1](https://forum.inductiveautomation.com/u/liam1)\
**Post date:** [April 21, 2023, 7:54am UTC](https://forum.inductiveautomation.com/t/username-property-of-user-object-not-returning-username/72751/1 "2023-04-21T07:54:57Z")

</div>

Hi all,

I'm trying to get the username from this user object

```auto
	roster=system.roster.getRoster("ttf_coldroom").getUsers()	
		
	for userObject in roster:
				
		logger.info(str(userObject.FirstName))

```

The property is returning a static string "username", the same issue for FirstName and LastName.

Here is the short list of the properties on the user object

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/9/897215a652557f089737efe51ebf847688dacf06.png)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/3/f3fd309f5ad4c66683784d9ccb05cd4bce934d5a.png)

Which property of this object contains the username?

---

<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:** [April 21, 2023, 2:45pm UTC](https://forum.inductiveautomation.com/t/username-property-of-user-object-not-returning-username/72751/2 "2023-04-21T14:45:37Z")

</div>

The `User` class is a property set class, something we use internally that's sort of akin to a Python dictionary, but with type safety.  
So the User class defines various static constants (such as `FirstName`) that define the properties; but to retrieve the actual _values_ from a given user object, you need to use an intermediate function like `get` or `getOrDefault`:

```python
roster = system.roster.getRoster("ttf_coldroom").getUsers()
		
for userObject in roster:
	logger.info(userObject.get(userObject.FirstName))

```

There's some more info on this in the `system.user.getUser` page: [system.user.getUser - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/system.user.getUser)

I'll make a note to the documentation to see if that information can't be made more visible.
