Advanced Form Building
This article goes deeper into the form field editor: data types, input types, validation, expressions and groups. The same editor is used for forms, custom fieldsets and your own content types, so everything here applies to all three. For the basics of creating a form, see Building Forms.
Data types
Every field has a Data Type, which decides what kind of value is stored:
| Data Type | Stores | Example use |
|---|---|---|
| Basic Text / String | Text, on one line or several | Names, comments, notes |
| Number / Decimal | Numbers with decimals | Measurements, ratings |
| Integer / Whole Number | Whole numbers | Quantities, ages, counts |
| Boolean | Yes or no | Opt-ins, confirmations |
| Date | A date, optionally with a time | Date of birth, preferred start date |
| Email Address | A validated email address | Contact email |
| URL | A web address | Website, portfolio link |
| Content Reference | A link to another record in Qik | Choosing an event, a team or a profile |
| Database Key | A machine-friendly identifier | Codes and keys |
| Generic Object Literal | Structured data | Locations, data from special widgets |
| No/Null value | Nothing — display only | Headings and explanatory text |
Fields can also be groups that contain other fields (see below).
Input types
The Input Type decides how the field looks and behaves for the person filling it in. The options depend on the data type. Common ones include:
- Text Field, Text Area and Rich Text Editor
- Select - Dropdown and Select - Buttons
- Checkbox and Switch
- Date Picker, Time Picker and Timezone Selector
- Currency and Range Slider
- Content Reference Search and Value Search
- File Upload, Signature Field, Location Select, Country Selector and Color
- Sensitive Text / Password and Hidden Value
- HTML Code — display formatted text or instructions inside the form
Field settings
How many answers
- Minimum Answers — 1 makes the field required; 0 makes it optional.
- Maximum Answers — 1 allows a single answer; 0 allows unlimited answers, turning the field into a list people can add to.
Options
For dropdowns and buttons, add Options. Each option has a title (what people see) and a value (what is stored). Options can also be loaded from a smart list or a URL.
Validation
Depending on the data type you can set:
- Minimum Numeric Value and Maximum Numeric Value for numbers.
- Minimum Character Length and Maximum Character Length for text.
- Earliest Date and Latest Date for dates.
- Allowed Answers to restrict which values are accepted.
Validation runs both in the form and on the server, so a submission that breaks the rules is rejected.
Display
- Prefix and Suffix — text shown before or after the input, such as "$" or "kg".
- Hide visually from user — keeps the field working (including validation and expressions) but doesn't show it. Useful for values calculated by an expression.
Expressions
Expressions let a field react to other answers. They are written as short JavaScript expressions on the field's Expressions tab and can read the form's answers through model, using each field's database key.
| Expression | What it does | Example |
|---|---|---|
| Show | Only show the field when the expression is true | model.hasDietaryNeeds |
| Hide | Hide the field when the expression is true | model.attendanceType == 'online' |
| Default Value | Pre-fill the field from other answers | model.email |
| Value | Always set the field to a calculated value | model.quantity * 25 |
| Reference Type | For reference fields, choose which kind of record can be selected | model.lookupType |
More examples:
model.country == 'AU'— only show a field when Australia is selected.model.firstName + ' ' + model.lastName— combine two answers.
Groups
A group holds several fields together. Group settings include:
- As Object — store the group's answers together under the group's key. Without it, the fields are saved as if they weren't grouped, and the group just organises the layout.
- Maximum Answers set to 0 — make the group repeatable, so people can add several entries (for example several emergency contacts). Use Plural to name the entries.
- Same Line — show the group's fields side by side.
- Show Label and Show Description — show the group's title and description above it.
- Collapsible — let people expand and collapse the group.
- Reorderable and Duplicatable — for repeatable groups, let people drag entries into order or copy an entry.
- Edit in Modal — edit each entry in a pop-up window.
Field templates
When adding a field you can start from a template, such as Person / Profile (names, email and phone), Address (street, suburb, state, postcode and country), File Upload or Date Picker. Templates add a ready-configured field or group that you can then adjust.
Tips
- Don't change a field's Database Key once people have started submitting — existing answers stay under the old key.
- Use the preview and Show Data Model to check exactly what will be saved.
- Test your conditional logic by filling in the form yourself with different answers before sharing it.