> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reyapp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Data

> Use Rey's built-in database to store and manage structured app data in tables — no external service, setup, or backend code required.

Every Rey project includes a built-in database that lets you store, organize, and retrieve structured data directly inside your app. Think of it as a lightweight spreadsheet that lives alongside your UI — you can read from it, write to it, and display its contents on the canvas without ever leaving Rey or connecting to an outside service.

## Open the Data panel

Click the **database icon** in the top toolbar to open the **Data** panel. From here you can see every table in your app, add new ones, and edit entries.

<Frame>
  <img src="https://mintcdn.com/rey-62fd4809/CynDnVly-UPIE_RC/images/data/panel.png?fit=max&auto=format&n=CynDnVly-UPIE_RC&q=85&s=703676b237e779ca8f06619bf3367069" alt="Data panel showing sample tables" width="3800" height="1654" data-path="images/data/panel.png" />
</Frame>

New projects come with two sample tables — **Actors (Sample)** and **Movies (Sample)** — that you can inspect, edit, or delete.

## Edit mode vs. live app

You work with data inside **edit mode**, which is sandboxed from your published app:

* Table setup (new tables, fields, permissions) is **promoted** to the live app the next time you publish.
* Entries and changes you make in edit mode are sandboxed — they do **not** affect the data in your live app.

See [Edit mode & Live mode](/publishing/edit-and-live-mode) for the full breakdown.

## Tables, entries, and fields

Data in Rey is organized into **tables**. Each table has:

* **Entries** — individual records (rows).
* **Fields** — the typed columns that describe each entry.
* **Permissions** — who can read and write entries at runtime.

To create your first table, see [Tables](/data/tables).

## Add entries manually

You can populate your table directly in the Data panel without writing any code.

<Steps>
  <Step title="Select your table">
    In the Data panel, click the table you want to edit. The table grid opens on the right.
  </Step>

  <Step title="Add an entry">
    Click **+ New entry**. A new empty row appears.
  </Step>

  <Step title="Fill in field values">
    Click any cell and type a value. Press **Tab** to move to the next field, or **Enter** to move down to the next entry.
  </Step>

  <Step title="Save your changes">
    Rey saves entries automatically as you type.
  </Step>
</Steps>

<Tip>
  Add a handful of realistic sample entries before building your UI. Seeing real content in your list components makes it much easier to design and test layouts.
</Tip>

## Bind a table to a List component

Once your table has data, you can display its entries on the canvas by binding the table to a **List** component.

<Steps>
  <Step title="Add a List component">
    Click the **+ button** in the bottom-right of the canvas, open the **Layout** category, and choose **List**.
  </Step>

  <Step title="Connect the List to a data table">
    Click the List to select it, open the property toolbar above it, and choose **Data**. Select your table — Rey immediately populates the list with one item per entry.
  </Step>

  <Step title="Select an element inside the List">
    Tap any element inside the List — for example, a Text label in the item template — and open its property toolbar.
  </Step>

  <Step title="Pick the data field">
    Choose **Data field** in the property toolbar, then pick the field to display (e.g., `Users > display_name`). The element now renders real data from that field and updates automatically when entries change.
  </Step>
</Steps>

## Read and write data with actions

Use database **actions** in your app's logic to interact with the database at runtime.

<CardGroup cols={3}>
  <Card title="Create entry" icon="plus">
    Creates a new entry in a table. Map form inputs or variables to each field you want to populate.
  </Card>

  <Card title="Update entry" icon="pencil">
    Edits an existing entry. Specify the entry and provide the new field values.
  </Card>

  <Card title="Delete entry" icon="trash">
    Removes an entry permanently — typically passed from the item the user tapped.
  </Card>
</CardGroup>

To add a database action, select a component, open the **Logic** tab in the property toolbar, click **+ Add action**, and choose the database action you need. See [Logic](/building/interactions) for the full flow.

## Filter and sort a List

You can narrow and reorder the entries displayed in a List component without writing any queries. Select the List, choose **Data** in the property toolbar, and use **+ Add filter** and **+ Add sort** to configure them. Rey applies filters and sorts live on the canvas.
