> For the complete documentation index, see [llms.txt](https://manual.bubble.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.bubble.io/help-guides/data/the-database/managing-data.md). Agents can also search and read this documentation through its [MCP server](https://manual.bubble.io/~gitbook/mcp).

# The database editor

This section covers Bubble's built-in database editor that lets you manage all the data in your app from one central place

The database editor is where you view and manage the data in your app. You'll find it in the **Data** tab, in the **App data** section. From here you can browse your data, search and filter it, edit values directly in the table, and import, modify, or export data in bulk.

{% hint style="info" %}
**The new database editor is in beta.** To try it, click **Try new** at the top of the **App data** section. To switch back to the previous editor, turn off the **Beta** toggle next to the *App Data* heading.
{% endhint %}

{% hint style="info" %}
Your app has **two separate databases**: one for the **development** version and one for the **live** version. The banner above the table shows which one you're viewing. See Switching between development and live data.
{% endhint %}

## An overview of the database editor

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2F92gXdZqWndVYbbC5exMs%2Fdatabase-editor-new-ui.png?alt=media&#x26;token=ad08fd1c-133a-426e-b000-7dc96bf463ae" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="211.23046875">Area</th><th>What it's for</th></tr></thead><tbody><tr><td>Data types and views</td><td>The list on the left shows your app's data types and any views you've created. Select one to show its data in the table.</td></tr><tr><td>Toolbar</td><td>Buttons for working with data in bulk: <strong>Bulk</strong>, <strong>Modify</strong>, <strong>Export</strong>, <strong>Import</strong>, and <strong>New entry</strong>. More options are in the <strong>⋮</strong> menu.</td></tr><tr><td>Table controls</td><td>Buttons to choose which columns to show and to filter the data, plus a search bar.</td></tr><tr><td>Database banner</td><td>Shows whether you're viewing development or live data, with a link to switch.</td></tr><tr><td>Table</td><td>Your data, with one row per record and one column per field. Each column shows the field's name and type. You can edit values directly in the table.</td></tr></tbody></table>

Compared to the previous editor, the new one lets you edit data directly in the table, makes filtering and column settings easier to reach, and splits large datasets into pages instead of loading more records as you scroll.

## Switching between development and live data

The banner above the table shows which database you're viewing, for example *Currently viewing dev data*. To switch, click **Switch to live** or **Switch to dev** in the banner.

{% hint style="warning" %}
Changes you make to live data affect your users right away. Check the banner before you edit, import, or delete data.
{% endhint %}

## Views

A view is a saved way of looking at the records of a data type. Each view is made up of:

<table><thead><tr><th width="138.7265625">Part</th><th>What it controls</th></tr></thead><tbody><tr><td>Columns</td><td>Which fields are shown in the table</td></tr><tr><td>Sorting</td><td>The order records are shown in</td></tr><tr><td>Filters</td><td>Which records are included</td></tr></tbody></table>

Bubble adds a default view for each data type, showing all its records. You can create as many extra views as you like, for example a view of *Users* who signed up this month, or *Orders* that haven't shipped yet. Views you create are listed under their data type on the left, and are shared between the development and live databases.

### Create a view

{% stepper %}
{% step %}

#### Open the data type's menu

In the list of data types and views, hover over the data type you want to create a view for, and click the **⋯** icon next to it.
{% endstep %}

{% step %}

#### Click Add View

In the menu, click **Add View**.
{% endstep %}

{% step %}

#### Give it a name

Give the view a name that describes what it shows.
{% endstep %}

{% step %}

#### Set up columns, sorting, and filters

Choose which columns to show, how to sort the records, and add filters to narrow down which records are included.
{% endstep %}
{% endstepper %}

The same menu also lets you duplicate the view with **Duplicate View**, rename it with **Rename**, add notes with **Add notes**, and open the data type's privacy rules with **Go to privacy rules**.

## Finding data

### Search

Type in the search bar above the table to find records in the current view. The search looks for the text you enter, or a record's unique ID.

When you search, common words like "the" and "and" (called *stop words*) are ignored, based on your app's default language.

{% hint style="info" %}
Search doesn't look inside fields that link to other data types, not even their primary fields. For example, if each *Project* has a *Company* field, searching *Projects* for "Acme" won't find a project linked to Acme Corp, unless "Acme" also appears in one of the project's other fields.
{% endhint %}

### Filter

Click the filter button next to the search bar to add filters. A filter limits the table to records that match a condition, for example *category is Technology*. You can combine several filters to narrow the results further, and save them as a view.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2FwES5tPJ7Jh0PU6FInj77%2Ffilters.png?alt=media&#x26;token=252a968d-5e11-4794-8e9f-d0985b1ba26f" alt=""><figcaption></figcaption></figure>

### Choose which columns to show

Click the columns button next to the filter button to choose which fields are shown in the table, and in what order.

### Browse large datasets

Large datasets are split into pages. Use the page controls below the table to move between them.

## Editing data

### Edit a value

You can edit most values directly in the table, without opening a separate editor.

{% stepper %}
{% step %}

#### Select the cell

Click the cell you want to edit.
{% endstep %}

{% step %}

#### Enter the new value

Type the new value, or choose one from the list for fields like option sets and linked data types.

<figure><img src="https://34394582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5sbzwG7CljeZdkntrL%2Fuploads%2Fk2LoBwLBLIdnE8TQYvZB%2Finline-editing.png?alt=media&#x26;token=a78d7118-d6c6-4b49-a662-83b739aa202d" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Save the change

Press Enter, or click outside the cell, to save. Press Escape to cancel.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
Changes are saved as soon as you confirm them. If you're viewing live data, they reach your users right away.
{% endhint %}

### Add a record

Click **New entry** in the toolbar, or **+ New entry** below the table. This works the same way as the **Create a new thing** action in a workflow.

### Delete records

Select the records you want to delete, then delete them. To delete many records at once, use a view with filters to show only the records you want to remove, and select them all.

### Keyboard shortcuts

You can use keyboard shortcuts to move around the table and edit values without reaching for the mouse. Which shortcuts work depends on where you are: in the table with a cell selected, in an open cell editor, in the list editor, or in the sidebar.

On a Mac, use Cmd instead of Ctrl.

#### With a cell selected

<table><thead><tr><th width="220">Shortcut</th><th>What it does</th></tr></thead><tbody><tr><td>Arrow keys</td><td>Move one cell. Hold Shift to extend the selection.</td></tr><tr><td>Ctrl+Arrow keys</td><td>Jump to the edge of the data. Add Shift to extend the selection.</td></tr><tr><td>Tab, Shift+Tab</td><td>Move to the next or previous cell. At the first or last cell, focus leaves the table.</td></tr><tr><td>Home, End</td><td>Move to the start or end of the row. Add Shift to extend the selection.</td></tr><tr><td>Ctrl+Home, Ctrl+End</td><td>Move to the top-left or bottom-right cell.</td></tr><tr><td>Page Up, Page Down</td><td>Move one page up or down. Add Shift to extend the selection.</td></tr><tr><td>Ctrl+A</td><td>Select all cells.</td></tr><tr><td>Ctrl+C</td><td>Copy the selection as tab-separated text.</td></tr><tr><td>Escape</td><td>Clear the selection.</td></tr><tr><td>Enter, F2</td><td>Open the cell editor. This doesn't work on yes/no or option set cells. Double-click those instead.</td></tr><tr><td>Any character</td><td>Open the cell editor and start with that character. This doesn't work on yes/no, option set, or address cells.</td></tr></tbody></table>

#### With a cell editor open

<table><thead><tr><th width="220">Shortcut</th><th>What it does</th></tr></thead><tbody><tr><td>Enter</td><td>Save and move to the cell below. This only works on text-like fields.</td></tr><tr><td>Shift+Enter</td><td>Add a new line.</td></tr><tr><td>Tab, Shift+Tab</td><td>Save and move to the cell on the right or left. In a list field, this adds the item you're typing instead.</td></tr><tr><td>Escape</td><td>Close the editor without saving.</td></tr></tbody></table>

#### In the list editor

<table><thead><tr><th width="220">Shortcut</th><th>What it does</th></tr></thead><tbody><tr><td>Enter, Tab</td><td>Add the item.</td></tr><tr><td>Ctrl+Enter</td><td>Save the list.</td></tr></tbody></table>

#### In the sidebar

<table><thead><tr><th width="220">Shortcut</th><th>What it does</th></tr></thead><tbody><tr><td>Escape</td><td>Close the search.</td></tr><tr><td>Enter, Space</td><td>Open the selected item.</td></tr></tbody></table>

## Primary fields

A primary field is the field that best describes a record of a data type. It's used to represent the record when it appears in another data type's field. For example, a *User* might be represented by their email, and an *Apartment* by its address. In the table, linked records are shown by their primary field.

Ideally, choose a field that's unique to each record. For users, the email is a good choice. If no other field works, the unique ID is always unique.

Primary fields are only used for display in the **App data** section. If you export a view, linked records appear as their primary field, but this doesn't apply to workflow actions like **Download data as CSV**.

## Running your app as a user

When you're debugging, it can help to see your app exactly as a specific user sees it. In the *User* data type, use the **Run as** option on a user's row to open your app in a new tab, logged in as that user.

{% hint style="warning" %}
You stay logged in as that user until you log out, and any changes you make are made as that user. Be careful not to change anything you shouldn't.
{% endhint %}

## Importing data

Click **Import** to upload data from a CSV file. The data type and its fields need to exist in your app before you import. Importing is available on paid plans.

{% stepper %}
{% step %}

#### Choose the data type and file

Select the data type to import into, choose the delimiter your file uses, and select the CSV file.
{% endstep %}

{% step %}

#### Map the columns to fields

For each column in your file, choose the field it should go into. See the table below for details.
{% endstep %}

{% step %}

#### Validate the data

Click **Validate data** to check the first rows of your file for errors before you upload.
{% endstep %}

{% step %}

#### Upload

Click **Upload data**. Bubble uploads the file and processes it in the background, using your app's server capacity. You can close the page while it runs. You'll get an email when the import is done, or if there's an error.
{% endstep %}
{% endstepper %}

<table><thead><tr><th width="213.5859375">Setting</th><th>What it does</th></tr></thead><tbody><tr><td>Type of data</td><td>The data type the records are imported into.</td></tr><tr><td>Data delimiter</td><td>The character that separates values in your file. Commas are most common, but tabs or pipes (|) work well when your data includes commas.</td></tr><tr><td>Custom field</td><td>The field each column is imported into.</td></tr><tr><td>Composite field</td><td>For columns that link to another data type, the field used to find the linked record. For example, if each <em>Apartment</em> has an owner, and your file lists owners by last name, choose <em>Last name</em>. The linked records need to exist before you import, and each value needs to match exactly one record.</td></tr><tr><td>List delimiter</td><td>For fields that hold a list, the character that separates the items. It needs to be different from the data delimiter. For example, with <code>;</code>, a list looks like <code>kitchen; bedroom; bathroom</code>. You can also wrap the list in square brackets: <code>[kitchen; bedroom; bathroom]</code>.</td></tr></tbody></table>

{% hint style="info" %}

* The first row of your file needs to be a header row with the field names. See [this sample file](https://s3.amazonaws.com/appforest_uf/f1454094816983x291920213727280500/normalfile.csv) for reference.
* All data needs to be valid for its field. For example, a yes/no field can only contain yes or no. Bubble checks every row before importing, and if one row fails, nothing is imported.
* Only one import or modify can run at a time in each app.
  {% endhint %}

If you regularly import large amounts of data, it's usually more efficient to create records with a script through the Bubble API.

## Modifying data in bulk

Click **Modify** to update many existing records at once from a CSV file. The file needs a column with the unique ID of each record you want to change, plus a column for each field you want to update.

## Running bulk operations

Click **Bulk** to run an API workflow on many records at once, for example to update or delete them. See [Bulk operations](https://manual.bubble.io/help-guides/maintaining-an-application/database-maintenance/bulk-operations.md) for details.

## Exporting data

Click **Export** to export the records in the current view as a CSV or JSON file. You'll get an email with a download link when the file is ready. Exporting is available on paid plans.

Since you're exporting as the app owner, privacy rules don't apply, and every field in the current view is included in the file.

{% hint style="info" %}
Make sure your app's scheduler isn't paused before you export.
{% endhint %}

## Copying and restoring the database

You can copy data between your development and live databases, restore a database to an earlier point in time, and delete your database's change history. See these articles for details:

**Article:** [Copying your database](https://manual.bubble.io/help-guides/maintaining-an-application/database-maintenance/copying-the-database.md)\
**Article:** [Restoring your database](https://manual.bubble.io/help-guides/maintaining-an-application/database-maintenance/database-copy-and-backups.md)\
**Article:** [Delete all database change history](https://manual.bubble.io/help-guides/maintaining-an-application/database-maintenance/wiping-change-history.md)

## Cleaning up your data

It's a good idea to clean up your database from time to time, especially as your app grows.

<table><thead><tr><th width="326.140625">To delete...</th><th>How</th></tr></thead><tbody><tr><td>A whole data type and all its records</td><td>In the <strong>Data types</strong> section of the <strong>Data</strong> tab, click the trash icon next to the data type. The data can't be recovered afterward.</td></tr><tr><td>Specific records</td><td>In the <strong>App data</strong> section, create a view with filters that show only the records you want to remove, then select and delete them.</td></tr><tr><td>Large numbers of records</td><td>Use a <a href="https://manual.bubble.io/help-guides/maintaining-an-application/database-maintenance/bulk-operations.md">bulk operation</a> to run an API workflow that deletes the records.</td></tr></tbody></table>

## FAQ: The database editor

<details>

<summary>Can I switch back to the previous editor?</summary>

Yes. While the new editor is in beta, you can switch back by turning off the **Beta** toggle next to the *App Data* heading.

</details>

<details>

<summary>Are views shared between development and live?</summary>

Yes. Views are shared between the two databases, but the data each view shows depends on which database you're viewing.

</details>

<details>

<summary>Do privacy rules apply in the database editor?</summary>

No. As the app owner, you can see and edit all your app's data in the database editor, regardless of privacy rules.

</details>

## Other ways to learn

<details>

<summary>Video lessons</summary>

* [How to create new database views](https://youtu.be/yUB4r-BFzwo)

</details>
