---
title: "getUserDirectoryName"
canonical: "https://support.appfire.com/space/PSCONF/15304418/getUserDirectoryName"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | getUserDirectoryName(userNameOrKey) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Returns the directory name the user belongs to (takes user name or key as a parameter).

Returns the directory name the user belongs to (takes user name or key as a parameter).

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | userNameOrKey | String | Yes | User name or key of a user to get directory name for. |

## Return Type

**String**

Returns the directory name.

## Example

```javascript
if (getUserDirectoryName(currentUser()) == "Confluence Internal Directory") {
    doSomethingRelatedToInternalDirectoryUsers();
}
```

## See also

> Macro (contentbylabel)