---
url: /process-functions/cube-rename.md
description: Renames a cube.
---

# cube.rename

Renames a cube.

The cube's id doesn't change, so anything that refers to it by id keeps working. Anything that refers to it by name needs updating.

```js
cube.rename(cubeName, newName)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `cubeName` | `string` | The cube's current name or id. |
| `newName` | `string` | The cube's new name. |

## Returns

An empty string when it succeeds, or `"Error: Cube not found."` when the cube can't be found.

## Examples

```js
cube.rename("Sales", "Sales History");
```
