Skip to content

alias.exists ​

Checks whether an alias exists within a dimension.

js
alias.exists(dimensionName, aliasName)

Parameters ​

ParameterTypeDescription
dimensionNamestringThe dimension's name.
aliasNamestringThe alias's name.

Returns ​

boolean

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");
}