Skip to content

alias.createOrWipe ​

Creates an alias within a dimension if it doesn't exist, or wipes the data on the alias if it already exists.

js
alias.createOrWipe(dimensionName, aliasName)

Parameters ​

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

Returns ​

string

An empty string when it succeeds, or an error message when it fails, such as when the dimension can't be found.

Examples ​

js
alias.createOrWipe("Account", "No - Name");
js
// Rebuild an alias from a file, starting empty
alias.createOrWipe("Product", "Long Name");

for (const row of datasource.csvRead("uploads/product_names.csv", 0)) {
    alias.set("Product", "Long Name", row.code, row.name);
}
  • alias.create: creates an alias within a dimension.
  • alias.wipe: wipes the data on an alias within a dimension, keeping the alias itself.