Form field types
Forms can be added to question or message nodes to prompt the user to manually enter information. This information will then be available within the flow as form data.
Forms have several different types of fields with different behavior depending on the kind of information the user is providing.
Text field
A text field that accepts arbitrary text.
Validation can be performed with simple minimum and maximum length requirements or with regular expressions. Invalid data will prevent the user from proceeding to the next node.
Values are stored as text strings. Numeric values can also be treated as numbers and be used with math operations in markup.
Customer email
A text field that only accepts an email address.
This is similar to the text field with two main differences:
- The field is automatically subject to validation that only accepts well-formed email address strings. This does not mean the email address itself actually exists or that it belongs to the user.
- The field is automatically associated with the reserved form data key
$customer-email
.
Values are stored as text strings.
Checkbox
A checkbox that the user can check or leave empty.
If a checkbox field is marked "Required", the user will not be allowed to submit the form until the box is checked. This can be useful for cases like ensuring the user accepts terms and conditions before proceeding.
Values are stored as true
if the box is checked or false
if it is not.
Description
A non-editable text snippet that can provide more information to the user.
No values are stored from descriptions.
Date field
A date picker.
Values are stored as strings with the format YYYY-MM-DD
. For example, the date January 31, 2000, would be stored as "2000-01-31".
Choice list
A dropdown menu from which the user can select an option.
Any number of options can be presented to the user. Each option has a value, which is what will be stored as form data, and can also have a label, which if specified will be displayed to the user instead of the value. Options are formatted as value
if there is no label, or value[label]
if there is one.
For example, you could specify a set of options as follows:
Swedish
American English[English (US)]
British English[English (UK)]
These would display to the user like this:
Swedish
English (US)
English (UK)
But if the user picked the option labeled "English (US)", the stored value would instead be "American English".
It is also possible to use form data to generate a list of options dynamically. For example, if you have a list of products in form data, you can present those products as options for the user to choose from by using markup.
Values are stored as text strings. Numeric values can also be treated as numbers and be used with math operations in markup.
Image/video upload
A file chooser allowing the user to upload one or more image or video files.
The files are uploaded to Mavenoid's servers and can be accessed at corresponding URLs. If you tick the "protected download" checkbox, only logged-in users will be able to download the files.
The maximum uploadable file size is 500 MB.
Values are stored as arrays of maps. Each map has three keys, "fileUrl"
, which has a value of a text string containing the file's URL on Mavenoid's servers, "fileType"
, which has a value of a text string containing the file's media type, and "fileName"
, which has a value of a text string containing the file's original name.
For example, if the user uploaded two files, screenshot.png
and screencapture.mp4
, the resulting form data value would look something like this:
[
{
"fileUrl":"https://mavenoidfiles.com/12345678abcdefgh12345678",
"fileType":"image/png",
"fileName":"screenshot.png"
},
{
"fileUrl":"https://mavenoidfiles.com/ijklmnop12345678ijklmnop",
"fileType":"video/mp4",
"fileName":"screencapture.mp4"
}
]
File upload
A file chooser allowing the user to upload one or more files.
The files are uploaded to Mavenoid's servers and can be accessed at corresponding URLs. If you tick the "protected download" checkbox, only logged-in users will be able to download the files.
The maximum uploadable file size is 500 MB.
Values are stored as arrays of maps. Each map has three keys, "fileUrl"
, which has a value of a text string containing the file's URL on Mavenoid's servers, "fileType"
, which has a value of a text string containing the file's media type, and "fileName"
, which has a value of a text string containing the file's original name.
For example, if the user uploaded the file receipt.pdf
, the resulting form data value would look something like this:
[
{
"fileUrl":"https://mavenoidfiles.com/98765432abcdefgh98765432",
"fileType":"application/pdf",
"fileName":"receipt.pdf"
}
]
Link
A non-editable link that the user can tap or click to visit the specified URL.
If a link field is marked "Required", the user will not be allowed to submit the form until the link has been opened. This can be useful for cases like ensuring the user views terms and conditions before proceeding.
No values are stored from links.