New 'Badge Number' Field has no method to access property

Our team has been trying to utilize the new badge field in user sources to pull in employee login numbers that we want to use to key into other databases. We can set the field, but we quickly realized that there is no actual way to get each user's badge number from their object data. For example, using system.user.getUser() on a user does not return any badge number value. Any thoughts on if we can access this field?

Hi @alex.chmelka,

Right. I've just tested it and I'm seeing the same thing - getUser() doesn't get the badge (Testing on 8.1.33).

A workaround is to query your database using system.db.runQuery(). That has allowed me to pull the badge number from a test user I've just created.

I was able to get the badge using system.user.getUser() heres what I did:

my_user = system.user.getUser('default', 'aaronrai24')
print my_user.get('Badge')

Badges are a property of the User object which gets returned by system.user.getUser(). I then looked at the PyUser class which has a get method to get the property I wanted.


This is the ticket! I had been looking at the API docs, but I had just missed that field. I had presumed that since the dictionary didn't return the badge field, that the pyUser object wasn't properly grabbing it. Thanks!