Username property of User Object not returning username

Hi all,

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

	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

Which property of this object contains the username?

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:

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

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