--- url: https://docs.codefox.ai/apps/pampas/build-a-form.md --- # Build a form This page shows you how to create a form, add questions and logic, give it a look and screens, and publish it as a version respondents can answer. ## Before you start * You can use Pampas. * To draft a form from a prompt, AI must be set up in Foxden Admin. Without it the **Prompt** tab does not appear. ## Create the form 1. Open **Forms** and select **New form**. 2. Pick how to start: * **Create**: a blank form. Type a **Form name** and a **Key**, then select **Create form**. * **Templates**: a ready form such as **Contact**, **Client intake**, **Event RSVP**, **Net Promoter Score**, **Job application** or **Order form**. Select **Create from template**. * **Import**: paste a form definition in JSON under **JSON definition**. * **Prompt**: describe the form under **Describe the form**. You can add a **Reference document (optional)** (plain text, Markdown, JSON, PDF or Word, up to 8 MB) and pick a template under **In the style of (optional)**. Pampas drafts the form for you to review. 3. The builder opens on an unpublished draft. The key must start with a letter and use only lowercase letters, numbers and underscores. It becomes the public address `/f/`, so pick it with care. ## Add and arrange questions The builder has three parts: the outline of pages and questions on the left, the form as respondents see it in the middle, and the inspector on the right. 1. Select **Add a field** and pick a type. Press `/` to search the types by name. 2. Select the question and fill in the inspector: **Label**, **Hint**, **Placeholder**, **Required**, and the question's checks, such as a minimum length or the accepted file types. 3. Drag questions in the outline to reorder them, or move them between pages. Select **Add page** to add a page. 4. To reuse a question in another form, select **Copy to clipboard** in its menu, then paste it from any page's menu in the other form. The question types are grouped in the picker: | Group | Types | |---|---| | Text | Short text, Long text, Email, Phone, URL, Number | | Choice | Select, Multi select, Yes / no, Picture choice, Ranking | | Scale | Rating, Opinion scale, Matrix | | Date and address | Date, Address | | Upload | File upload, Signature | | Layout | Statement, Section (text only, no answer) | Each question also has a **key**, which names its answer in the CSV export, webhooks and Fennec. Keys lock once the form has responses. A **Signature** question records a drawn mark, not a sealed electronic signature. For an agreement that needs one, use [Corsac](/apps/corsac/). ## Show earlier answers in a label Type `@{field.key}` in a label, hint or message to show an earlier answer there, with the question's key in place of `key`. Add a fallback after a bar: `@{field.first_name|there}`. Use `@{hidden.name}` for a hidden field and `@{var.name}` for a variable. ## Add logic 1. Open **Logic**. 2. Select **Add rule**, or start from **Show a question**, **Hide a question**, **Make one required**, **Jump to a page** or **Calculate a value**. 3. Set **When**: the question, variable or hidden field, the condition and the value. 4. Set **then**: one or more actions. 5. Select **Test logic** and try answers. Nothing you enter there is saved. Rules run from top to bottom. For show, hide and require, a later rule wins; for jumps, the first match wins. Rules change what people see; they keep nothing private. Anyone who can open the form can read its rules, variables and hidden field names. ## Set the form's behaviour In the builder, select **Form** in the inspector: * **Layout**: **Classic** shows a page at a time; **Focus** shows one question at a time. * **Hidden fields**: names of link parameters saved with each response without being asked, for example a campaign name you put in the link. * **Data capture**: **Capture UTM parameters** is on by default and keeps `utm_source` and the other campaign tags from the link. * **Privacy**: a **Privacy policy link** shown on the form. * **Variables**: numbers or text that logic can calculate, such as an order total. * **Closing**: **Close at** a date and time, a **Response limit**, and the **Closed message** people see after it. * **Editing after submit**: **Let respondents edit their response** from their private link, within an **Edit window (days)** (30 by default). ## Add a theme and screens 1. Select **Theme** in the inspector. Pick a **Preset** (Den, Editorial, Dark, Minimal, Signal, Grove or Contrast), then change colours, **Radius**, **Density**, the font, a **Logo**, a background image, **Button style** and **Progress style**. Select **Save theme preset** to reuse the look on other forms. 2. Select **Welcome** and then **Add welcome screen** if you want a first screen before the questions. 3. Select **Thank you** to write the thank-you screen. A **Redirect URL** sends respondents to another page after they submit, and **Forward answers** adds chosen answers to that address. A redirect takes respondents away before they can open the private link to their answers on the thank-you screen. If you redirect, consider an auto-reply that carries that link (see [Send responses to your team and tools](/apps/pampas/send-responses)). ## Publish 1. Select **Preview** to check the form. Preview answers are not saved. 2. Select **Publish**. Pampas lists what changed since the live version and how many people are part-way through it. They finish on the version they started; everyone else gets the new one. 3. Choose **Retention**: **30 days**, **90 days**, **365 days**, **Custom…** (1 to 3650 days) or **Keep indefinitely (you must justify this in your privacy notice)**. Under **File retention** you can keep uploaded files for a shorter time than the answers. 4. Select **Confirm v1** (or the next number). Respondents get the new version at once. If the form asks for personal details such as an email address or phone number and has no privacy policy link, Pampas warns you before you publish. ## Manage versions Open **Versions** to see every published version and which one is live. * **Restore into working copy** copies a version back into the builder. Respondents see no change until you publish. * **Withdraw** stops a version taking answers at once, even from someone part-way through it. ## Close, reopen or delete a form * To stop taking answers, select **Close form** on **Share**, or **Close** in the form's menu on **Forms**. People who already started can still send their answers. Select **Reopen form** to take answers again. * You can delete only a draft that was never published and has no responses. Close a published form instead; its responses stay. ## Troubleshooting ### Publish shows "Fix these issues first" The form has problems that would break it, such as two questions with the same key or a choice question with no options. Select an issue in the list to go to it, fix it, then select **Check again**. ### Publish says "Give every question a label before publishing." A question has no label. Select its name under the message to go to it and type a label. ### Confirm is greyed out Point at the button to see why. **Nothing has changed since** the live version means there is nothing to publish. Otherwise a retention number is missing or out of range. ### "This form changed elsewhere. Reload to continue." Someone else changed the form while you had it open. Select **Reload**; your unsaved change is lost, so make it again. ### The key of a question cannot be changed The form already has responses, and keys lock then so exports and integrations keep working. Add a new question if you need a new key. ### The Prompt tab is missing AI is not set up for Pampas in Foxden Admin. See [Set up AI](/run-your-company/ai).