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
booleantrue 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: creates an alias within a dimension.