---
url: /process-functions/alias-exists.md
description: Checks whether an alias exists within a dimension.
---

# alias.exists

Checks whether an alias exists within a dimension.

```js
alias.exists(dimensionName, aliasName)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `dimensionName` | `string` | The dimension's name. |
| `aliasName` | `string` | The alias's name. |

## Returns

`true` when the alias exists, otherwise `false`, including when the dimension can't be found.

## Examples

```js
if (alias.exists("Account", "No - Name")) {
    // do something
}
```

```js
// Create the alias only when it's missing
if (!alias.exists("Product", "Long Name")) {
    alias.create("Product", "Long Name");
}
```

## Related

* [alias.create](/process-functions/alias-create): creates an alias within a dimension.
