# Versions and publishing

URL: https://docs.sparklayer.io/help/forms/versions

Edit a SparkLayer form as a draft, preview it, publish it as the live version and understand how new versions affect existing and in-progress entries.

> **Quick summary**
>
> - You edit a form as a draft. Customers keep seeing the published version until you click **Publish**.
> - The form builder shows the form's status, **Draft** or **Published**, next to its name. Open it from **Forms** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/forms)). Forms is only in the SparkLayer Dashboard, not in the SparkLayer Wholesale app in Shopify admin.
> - Publishing can include the form fields, the internal fields and the workflows. Existing entries keep the version they were created with, so publishing never changes them.

## How it works

Each form has versions, so you can change it without interrupting live submissions. A form is always in one of these states:

| State | What it means |
| --- | --- |
| **Draft** | Changes you're still working on. Customers don't see them. |
| **Published** | The live version, used for new submissions and for forms embedded on your store. Read only. |
| **Archived** | Older versions, kept for reference and for the entries created with them. |

A form has at most one draft and one published version at a time.

How a change goes live:

1. **Edit**: A draft is created from the published version. Changes save automatically.
2. **Preview**: Test the draft. Preview entries are kept separate.
3. **Publish**: The draft becomes the published version.
4. **Archive**: The previous published version is archived.

The top of the form builder shows the form's name and status. **Publish** appears while there are unpublished changes. The **More actions** menu has **View entries**, **Duplicate** and **Archive**. 

## Edit a draft

1. Open the form from **Forms** in the SparkLayer Dashboard ([open](https://app.sparklayer.io/forms)).
2. Make sure you're editing the draft.
3. Make your changes. They save automatically, and the live form stays the same.

When you start editing, SparkLayer creates the draft from the current published version. To look at what's live without changing anything, select **Published**.

## Preview a draft

1. Click the **Preview** tab.
2. Fill in the form to test your changes, including validation and conditional logic.

Preview entries are marked separately from real entries. Preview whenever you change the structure, logic or workflows.

The preview has no logged-in customer. If your form uses customer or purchase data, test it on your store instead. Use a page where the SparkLayer Core Script is loaded, signed in as a customer. The page can be hidden while you test.

## Publish changes

1. Click **Publish**.
2. Choose what to publish (see the table below).
3. Add a summary of your changes. It's kept for future reference, which helps with audits.
4. Confirm. The draft becomes the published version. 

| Option | What it publishes |
| --- | --- |
| **Form fields** | The main form customers see. |
| **Internal fields** | The admin fields shown against entries. |
| **Workflows** | Your automations and their logic. |

The previous published version is archived, and all new submissions use the new version.

## How versions affect entries

Publishing never changes entries you already have. Which version an entry uses depends on when it was started:

| Entry | Which version it uses |
| --- | --- |
| **New submissions** | Always the current published version, with its fields, validation and workflows. |
| **Existing entries** | The version they were created with. Their data structure and workflows stay the same. |
| **In-progress entries** | If a customer started the form before you published, they continue on the version they began with. They see your changes the next time they start a new submission. |

## Tips

- Publish all affected areas (form fields, internal fields and workflows) together where you can.
- Always write a clear summary in the **Publish** dialog.
- Test a new version before you share the form.
- To completely rethink a form, create a new form rather than reworking the existing one.

## Next steps

- [Build a form](https://docs.sparklayer.io/help/forms/setup.md): Create a form and organise it into pages, fields and groups
- [Form workflows](https://docs.sparklayer.io/help/forms/workflows.md): Automate what happens after a customer submits a form
- [Form entries](https://docs.sparklayer.io/help/forms/entries.md): Review, approve and export the submissions your form collects
