# llRequestDisplayName

*LSL function*

```lsl
key key llRequestDisplayName(key id);
```

- `key id`: UUID of the avatar to query.

- Returns: `key`
- Energy: 10

Requests the **[Display Name](https://wiki.secondlife.com/wiki/Display_Names)** of the agent identified by **id**. When the Display Name is available the [dataserver](/events/dataserver/) event will be raised. The agent identified by **id** does not need to be in the same region or online at the time of the request.

```lsl title="How to use" frame="terminal"
key result = llRequestDisplayName(NULL_KEY);
```

## Caveats

- If the request fails for any reason, there will be no error notice or dataserver event. You may use a timer to check for stale requests.
- If you merely wish to show the agent display name in the viewer window, it may be more straightforward to use [Viewer URI Name Space](/features/viewer-uris/) and avoid a dataserver event, e.g.:

  ```lsl
  llSay(0, "secondlife:///app/agent/" + (string)id + "/displayname");
  ```

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-7, 13-20}
key owner_key;
key owner_name_query;
string owner_display_name;

default
{
    state_entry()
    {
        owner_key = llGetOwner();
        owner_name_query = llRequestDisplayName(owner_key);
    }
    dataserver(key queryid, string data)
    {
        if ( owner_name_query == queryid )
        {
            owner_display_name = data;
            llSay(0, "The display name of the owner of this script : " + owner_display_name );
        }
    }
}
```

</details>

## See also

### Functions

- [llGetDisplayName](/functions/llGetDisplayName/)
- [llRequestUsername](/functions/llRequestUsername/)

### Events

- [dataserver](/events/dataserver/)

---

*Source: [LlRequestDisplayName](https://wiki.secondlife.com/wiki/LlRequestDisplayName) on the Second Life Wiki. Content from the Second Life Wiki articles LlRequestDisplayName (revision 1216491, 2024-04-15), Template:LSL Function/avatar (revision 1179236, 2013-06-15) and Template:LSL Function/warning (revision 1168838, 2012-06-11), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llRequestDisplayName/
