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
| Parameter | Type | Description |
|---|---|---|
dimensionName | string | The dimension's name. |
aliasName | string | The alias's name. |
Returns
stringAn 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);
}Related
- alias.create: creates an alias within a dimension.
- alias.wipe: wipes the data on an alias within a dimension, keeping the alias itself.