# Save form responses to a database

> Connect an HTML form to a table, map its fields and choose how submissions create or update records.

Source: https://docs.formclick.io/databases/database-form-sync

Connect an HTML form to a table and every new submission is written there as a record. The submission is always saved, emailed and shown in **Submissions** first; writing the record is a separate step that never changes or loses the submission.

### Step 1: Open the form’s Database settings

Open the form, then **Settings → Database**.

### Step 2: Choose where to save

Under **Save responses to**, choose **Existing database** and pick a table, or **New database** to create one with a table for this form. **No database** keeps responses in Submissions only.

### Step 3: Map fields

Pair each form field with a table field. **Auto-match** pairs fields with similar names. Form fields come from your embed snippet and recent submissions; you can also type a field’s name.

### Step 4: Choose a mode and save

Pick how submissions are written (below), then **Save connection**. Send a test submission to check.

## Modes

| Mode | What it does |
| --- | --- |
| Create new record | Every submission becomes a new record. |
| Find or update | Updates the record whose match field has the same value; creates one if none matches. |
| Update only | Updates a matching record. Submissions without a match never create records. |

For **Find or update** and **Update only**, choose the field to **Match records by**, for example Email. Turn on **Don’t overwrite with empty values** so a blank form field leaves the existing value alone.

## Submission details

Besides your form’s own fields, you can map these submission details to table fields:

| Source | Value |
| --- | --- |
| Submission date | When the submission was received. |
| Submission ID | The submission’s unique ID. |
| Page URL | The page the form was submitted from. |
| Sender email (detected) | The email address found in the submission. |

## Pause, change or retry

- Turn off **Connection enabled** to stop writing to the database without losing the setup.
- **Recent sync results** shows each submission’s outcome (created, updated, skipped or failed). Use **Retry** after fixing a problem.
- Moving the form to a different table only affects new submissions; records already created stay where they are.

> **Note:** Form-to-database sync works with **HTML forms**. Each form saves to one table. New records count toward your plan’s record limit: if your account reaches it, submissions are still saved in Submissions, but they aren’t copied to the table until you upgrade or free up space (the sync result shows **Plan limit reached**; use **Retry** afterwards). See [Plans and limits](https://docs.formclick.io/databases/database-limits).
