Forms Builder
Build forms that collect input from your platform's users.
Open Forms from your project's side menu to manage your forms.
Creating a Form
- Go to Forms.
- Click Add, enter a name, and click Create.
- The new form opens so you can configure its fields.
Form Details
Each form has:
- Name: how the form is identified in your project.
- Submit Button Label: the text shown on the form's submit button.
Adding Fields
Forms use the same field editor as collections, so you have the full set of field types available. Under Fields, click Add Field to add a field, then set:
- Field Label: the text shown next to the input.
- Type: the kind of input (text, number, date, select, and so on — see the field types in Collections & Data Modeling).
- Required: whether the field must be filled in.
- Regex Pattern: an optional regular expression the value must match.
Click Add Section to group the fields that follow into a named section, and End Section to close it. Sections help organize longer forms.
Select and Multi-Select fields link to one of your collections. When you pick one of these types, a second list appears under the type to choose the collection, and the first collection is linked automatically. If your project has no collections yet, no list appears and the form can't be saved until you create a collection and link it.
Saving and Validation
Click Save to store the form. The builder checks your form before saving and will warn you if:
- the form has no name,
- a section is missing a name,
- a field is missing a label,
- a select field has no linked collection, or
- a regex pattern is not a valid regular expression.
Showing a Form to Users
A form reaches your platform's users through a page. Add a Form block to a page and choose the form it shows. See Pages & Navigation.
Submissions
When a user submits a form on your generated platform, the submission is stored in that platform's own database, in a table dedicated to the form.
Using the CLI
Forms are managed from the CLI in two ways:
devour form create,devour form edit,devour form list, anddevour form deletemanage forms interactively.devour syncwrites the project'sformsinto the configuration file. Forms you edit in that file are sent to the server by the nextdevour sync, before it pulls the server's forms back. A form updates the server form with the sameid, or with the same name when it has noid. Any other form is created.devour setupdoes not apply forms.
See the CLI Reference for every option.