Field Types
Every field has a type. The type determines what kind of value the field accepts and how it appears in the certificate form. You can change a field's type later with the type switcher. The video on the Schema Builder page shows the switcher in use.
Available Types
| Type | Use it for |
|---|---|
| Text | Plain text values. |
| Number | Numeric values. Can be restricted to whole numbers. |
| Date | A date, or a date and time. |
| Image | An uploaded image or file. |
| Toggle | An on/off (true or false) value. |
| Dropdown | A single choice from a fixed list of options. |
| List | Repeated items, such as several test results. A new list already contains one item, shown as Items, which you configure in the tree. |
| Group | A set of related fields nested together. |
| All Of | A value that must meet all of several sets of rules. See All Of and One Of. |
| One Of | A value that must match exactly one of several variants. See All Of and One Of. |
One more type appear in the builder but cannot be chosen from the type menu:
- Reference: created when you link fields together. See Siblings.
Type Settings
All fields have a Title, a Description, and a Required setting. The settings below are specific to each type. For what each rule means, see Validation Rules. The end of the video on the Schema Builder page shows the options of a Dropdown field.
| Type | Settings |
|---|---|
| Text | Fixed Value, Minimum/Maximum Length, Format (Email, URI, UUID, Hostname, IPv4, IPv6), Pattern (regex), Placeholder |
| Number | Allow only whole numbers, Fixed Value, Minimum / Exclusive Minimum / Maximum / Exclusive Maximum, Multiple Of, Placeholder |
| Date | Date Format ("Date only" or "Date and time"), Fixed Value, Placeholder |
| Image | Image Type (PNG, JPEG, WebP) |
| Toggle | Allowed Values (Any / Must be true / Must be false), Fixed Value |
| Dropdown | Options (the list of choices), Fixed Value |
| List | Min Items / Max Items |
| Group, All Of, One Of | None |
All Of and One Of
All Of and One Of are advanced field types. Both are containers whose child fields you add in the tree.
- All Of: the value must meet every child, called a branch, at the same time. Example: a part number that must start with a letter and be at most 10 characters. Each rule is a branch.
- One Of: the value must match exactly one child, called a variant. Example: a contact that is either an email address or a phone number. The person filling out the certificate opens the variant that applies and fills in only that one.
A new All Of starts with one branch titled Schema 1, a new One Of with two variants titled Option 1 and Option 2. You can rename them, and each is configured like any other field.
Good to know:
- Design One Of variants so that a value can match only one of them. A value that matches two or more variants fails validation.
- Avoid conflicting rules across All Of branches. If one branch requires a minimum of 10 and another a maximum of 5, no value can pass. The builder warns about conflicting ranges where it can.
anyOfis not available from the type menu.
In JSON Schema
All Of and One Of map directly to allOf and oneOf.
The part number example:
{
"type": "object",
"properties": {
"partNumber": {
"title": "Part Number",
"allOf": [
{ "type": "string", "pattern": "^[A-Za-z]" },
{ "type": "string", "maxLength": 10 }
]
}
}
}
The contact example:
{
"type": "object",
"properties": {
"contact": {
"title": "Contact",
"oneOf": [
{ "title": "Email", "type": "string", "format": "email" },
{ "title": "Phone", "type": "string", "pattern": "^\\+?[0-9 ]+$" }
]
}
}
}
JSON Schema Structure
| Field type | JSON Schema |
|---|---|
| Text | "type": "string" |
| Number | "type": "number", or "type": "integer" for whole numbers |
| Date | "type": "string" with "format": "date" or "format": "date-time" |
| Toggle | "type": "boolean" |
| Dropdown | "type": "string" with an enum of options |
| List | "type": "array" |
| Group | "type": "object" |
| All Of / One Of | allOf / oneOf |
A group with a text field, a number field, and a dropdown:
{
"type": "object",
"properties": {
"heatNumber": { "title": "Heat Number", "type": "string" },
"thickness": { "title": "Thickness", "type": "number" },
"grade": { "title": "Grade", "type": "string", "enum": ["S235", "S355"] }
},
"required": ["heatNumber"]
}