> For the complete documentation index, see [llms.txt](https://docs.codemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemash.io/cloud/database/collections/add-records.md).

# Add Records

**Where:** Database → Collections → collection → Records → New / Edit · `/projects/<project>/db/collections/<collection>/records/new · …/<recordId>/edit`

{% hint style="info" %}
Screenshot TODO — capture comes from testing-plan area **03-database-collections**.
{% endhint %}

The record form is generated from the collection's two schemas: the **Data schema** provides the fields and validation, the **UI schema** provides the layout — tabs, containers with headers, and cells on a 12-column grid. The page title carries the collection and its version, e.g. **Add New Record — Employees (v2)** or **Edit Record — Employees (v2)**.

## Fields

Every schema field renders with its assigned widget: text (including `email`, `uri`, and HTML formats), number, date, rating, boolean, select, tags, file upload, geolocation, taxonomy-term picker, and record reference. The Data schema's validation rules (required fields, formats, ranges) run before save — an invalid form does not submit.

For an `Employees` schema with a required `firstName` (string) and a `salary` (number), the form shows those two inputs in the layout the UI schema defines, and refuses to save while `firstName` is empty.

Buttons: **Create** (new record) or **Update** (editing), **Cancel** back to the records list, and **Delete** with a confirmation dialog when editing. After a successful save you return to the records list.

## Use it from code

[Database → Collections](/sdks-and-cli/database/collections.md) — `insertOne` and `replaceOne` run the same validation.

## API reference

Endpoints: [Insert One](/api-reference/database/collections/insert-one.md) and [Replace One](/api-reference/database/collections/replace-one.md).
