---
url: /process-functions/alias-createorwipe.md
description: >-
  Creates an alias within a dimension if it doesn't exist, or wipes the data on
  the alias if it already exists.
---

# 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

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

## Related

* [alias.create](/process-functions/alias-create): creates an alias within a dimension.
* [alias.wipe](/process-functions/alias-wipe): wipes the data on an alias within a dimension, keeping the alias itself.
