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

**URL:** <https://forum.inductiveautomation.com/t/new-badge-number-field-has-no-method-to-access-property/80647>\
**Category:** Ignition\
**Created:** [October 18, 2023, 2:27pm UTC](https://forum.inductiveautomation.com/t/new-badge-number-field-has-no-method-to-access-property/80647 "2023-10-18T14:27:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex.chmelka](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alex.chmelka/32/26672_2.png) [@alex.chmelka](https://forum.inductiveautomation.com/u/alex.chmelka)\
**Post date:** [October 18, 2023, 2:27pm UTC](https://forum.inductiveautomation.com/t/new-badge-number-field-has-no-method-to-access-property/80647/1 "2023-10-18T14:27:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![MTekin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mtekin/32/50257_2.png) [@MTekin](https://forum.inductiveautomation.com/u/MTekin)\
**Post date:** [October 27, 2023, 11:36pm UTC](https://forum.inductiveautomation.com/t/new-badge-number-field-has-no-method-to-access-property/80647/2 "2023-10-27T23:36:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![aaronrai24](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/aaronrai24/32/87248_2.png) [@aaronrai24](https://forum.inductiveautomation.com/u/aaronrai24)\
**Post date:** [October 28, 2023, 12:08am UTC](https://forum.inductiveautomation.com/t/new-badge-number-field-has-no-method-to-access-property/80647/3 "2023-10-28T00:08:49Z")

</div>

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

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

```

Badges are a property of the [User object](https://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.12/com/inductiveautomation/ignition/common/user/User.html) which gets returned by `system.user.getUser()`. I then looked at the [PyUser class](https://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.12/com/inductiveautomation/ignition/common/user/PyUser.html) which has a `get` method to get the property I wanted.

---

<div class="post-metadata">

**Author:** ![alex.chmelka](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alex.chmelka/32/26672_2.png) [@alex.chmelka](https://forum.inductiveautomation.com/u/alex.chmelka)\
**Post date:** [October 30, 2023, 1:24pm UTC](https://forum.inductiveautomation.com/t/new-badge-number-field-has-no-method-to-access-property/80647/4 "2023-10-30T13:24:15Z")

</div>

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!
