# Build a form with an AI agent

Ask Claude, ChatGPT, Cursor or another connected agent to build a Formstep form, watch it take shape in a preview, change it, and publish it.

## Before you start

You need an AI tool with [Formstep connected](https://formstep.io/docs/guides/ai-agents/connect/). Any wording works for the prompts below, as long as it says what to ask and whether to publish.

## 1. Describe the form

Name the form, list what it should ask, and say that it stays a draft for now:

```
Build a Formstep form called "[Guide] Supplier onboarding". Ask for the company name, a contact email, the company's VAT number, and whether they accept our 30-day payment terms (yes or no). Keep it as a draft and send me the preview link.
```

The agent creates the form in the workspace you connected, adds one question at a time, and reads the form back to check the order. It picks a question type for each item: an email field for the contact email, a single choice for yes or no. When it is done, it replies with the questions it added and a preview link.

## 2. Open the preview

The preview link shows the draft as the recipient will see it, and it follows the agent’s edits live, so keep it open while you ask for changes.

What the agent builds is an ordinary form: it is in Formstep under **Forms**, where you can open it in the editor and change anything by hand.

## 3. Ask for changes

Say what to change in the same conversation, naming the questions by their titles:

```
Make the VAT number optional and add a file upload for their certificate of incorporation at the end.
```

The open preview shows the change as soon as the agent makes it:

![The preview of the Supplier onboarding draft after the change: a note that this is an unpublished version, then Company name, Contact email, VAT number, a Yes or No question about 30-day payment terms, a Certificate of incorporation upload, and a Submit button](https://formstep.io/docs/guides/ai-agents/form-preview.png)

Most of what you set in the editor, you can ask an agent for: required or optional, a description, choice options, conditional logic, the theme, translations. For long forms, ask for one part at a time and check the preview in between.

## 4. Publish and get the field keys

When the preview looks right, ask the agent to publish:

```
Looks good. Publish it, give me the link to share, and list each question's field key.
```

The agent publishes the form and lists the [field keys](https://formstep.io/docs/requests/field-keys/). The first publish always creates a [share link](https://formstep.io/docs/sharing-publishing/sharing-embedding/#share-links) anyone can open, and the agent gives it to you. An agent reads the keys from the published form, so asked before you publish, it says it cannot list them yet.

Each key comes from the question’s title: _Company name_ becomes `company_name`. Keys are how a request prefills a question and how the answers come back, and they [stay the same](https://formstep.io/docs/requests/field-keys/#freeze) when you later rename a question. An agent cannot choose a key. To shorten a long one, edit it in the editor’s [Fields tab](https://formstep.io/docs/requests/field-keys/#where), best before the first publish, while no automation uses it yet.

> **Publishing makes the form live**
>
> Once published, anyone with the share link can submit the form. To take answers only from named people, ask the agent to revoke the share link and [send requests](https://formstep.io/docs/guides/ai-agents/send-a-request/) instead.

## Next steps

[Send a request with an AI agent](https://formstep.io/docs/guides/ai-agents/send-a-request/) — Ask one person to complete the form, prefilled, and read their answers back

[Question types](https://formstep.io/docs/building-forms/field-types/) — Every question type an agent can add
