# Account link related issue

**URL:** <https://discourse.getcockpit.com/t/account-link-related-issue/1885>\
**Category:** Support\
**Created:** [March 25, 2021, 7:02am UTC](https://discourse.getcockpit.com/t/account-link-related-issue/1885 "2021-03-25T07:02:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dipakmali1993](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/dipakmali1993/32/798_2.png) [@dipakmali1993](https://discourse.getcockpit.com/u/dipakmali1993)\
**Post date:** [March 25, 2021, 7:02am UTC](https://discourse.getcockpit.com/t/account-link-related-issue/1885/1 "2021-03-25T07:02:38Z")

</div>

i m trying here to dispaly my account user name in listing. i m using account-link to attach the user data but how can i display the username instead of \_id

 ![Screenshot 2021-03-25 at 12.32.12 PM](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/1X/b3a8bf473aef7a24faaa0dcefb664a0946868579.png) .

---

<div class="post-metadata">

**Author:** ![dipakmali1993](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/dipakmali1993/32/798_2.png) [@dipakmali1993](https://discourse.getcockpit.com/u/dipakmali1993)\
**Post date:** [March 25, 2021, 8:07am UTC](https://discourse.getcockpit.com/t/account-link-related-issue/1885/2 "2021-03-25T08:07:06Z")

</div>

can anyone help me on above?

---

<div class="post-metadata">

**Author:** ![raffaelj](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/raffaelj/32/331_2.png) [@raffaelj](https://discourse.getcockpit.com/u/raffaelj)\
**Post date:** [March 25, 2021, 10:02am UTC](https://discourse.getcockpit.com/t/account-link-related-issue/1885/3 "2021-03-25T10:02:10Z")

</div>

I see two options:

1. Create a custom renderer for the entries view, that calls `/accounts/find` to get the related user data and display that instead of the id.
2. Use the event system to replace the ids before they are fetched and displayed.

## event system

See [Account-Link Display Option - #2 by raffaelj](https://discourse.getcockpit.com/t/account-link-display-option/645/2)

By the way, this is the first result if you search for “account link” in this forum 😉

## renderer

The account-link field doesn’t have it’s own renderer, so the default one is used to display a string.

> <https://github.com/agentejo/cockpit/blob/next/assets/app/js/app.utils.js#L269-L272>

I wrote a mini tutorial about custom renderers here:

> <https://github.com/raffaelj/cockpit-scripts/blob/master/custom-renderers/README.md>

The interesting bit for the id replacement can be found in the core source

> <https://github.com/agentejo/cockpit/blob/next/modules/Cockpit/assets/components/field-account-link.tag#L178>

> <https://github.com/agentejo/cockpit/blob/next/modules/Cockpit/Controller/Accounts.php#L213>
