# Find a user by ID or username?

**URL:** <https://meta.discourse.org/t/find-a-user-by-id-or-username/62582>\
**Category:** Development\
**Created:** [12 Maggio 2017, 12:22pm UTC](https://meta.discourse.org/t/find-a-user-by-id-or-username/62582 "2017-05-12T12:22:21Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Radulf](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Radulf](https://meta.discourse.org/u/Radulf)\
**Post date:** [12 Maggio 2017, 12:22pm UTC](https://meta.discourse.org/t/find-a-user-by-id-or-username/62582/1 "2017-05-12T12:22:21Z")

</div>

And another “simple” question from me and basically a follow up to [Showing simple text with decorateWidget - #5 by vinothkannans](https://meta.discourse.org/t/showing-simple-text-with-decoratewidget/62521/5)

I want to decorate the post with a custom field from the posting user. To do this, I want to get the user object. I already realized, that I can get the username or user\_id from the helper, i.e.,

```
var username = helper.attrs.username
var user_id = helper.attrs.user_id

```

How can I reach the user object from there? I found something about a User.find() method somewhere, but I’m not able to access it even though I import User from discourse/models/user. I also try to user Discourse.User.findByUsername(), but that returns a Promise and I have no idea how to handle that.

Do I need some additional imports or am I doing things wrong? Thanks a lot!

---

_[View the full topic](https://meta.discourse.org/t/find-a-user-by-id-or-username/62582)._
