-
Notifications
You must be signed in to change notification settings - Fork 28
5. Form Specification
Elly Kitoto edited this page Jul 9, 2020
·
2 revisions
A form is basically a collection of views. A form can have views grouped together in one logical section referred to as a Step
. Each step has a navigation button to take you to the next step or move back to the previous one. In addition each form with a step has a complete action that is invoked when your reach its end. You can use this action to submit the data obtained from the form.
You can as well pass additional data to the form via the form_meta_data
attribute.
Below are the current supported attributes that you for forms and step.
Form Attribute | Usage | Required |
---|---|---|
form | Name of your form | Yes |
rules_file | Path to the file containing the rules for handling skip logic and calculation | No |
steps | The form steps with the desired fields | Yes |
metadata/meta_data | Additional information that you would also like to pass with the form when submitting data | No |
Form Attribute | Usage | Required |
---|---|---|
title | Title of the step | Yes |
fields | Array of fields (views) to display on the step | Yes |
{
"form": "Profile",
"form_version": "1.0.0",
"rules_file": "rules/yml/sample_one_form_rules.yml",
"steps": [
{
"title": "Demographics",
"fields": [
{
"name": "adult",
"type": "text_input_edit_text",
"properties": {
"hint": "Enter adult's phone number",
"type": "name"
},
"subjects": "age:number, child:text",
"required_status": "Yes:please add phone number"
}
]
}
]
}
NOTE: a form must have at least one step.
Created by Elly Nerdstone with the help of some awesome contributors. License Apache 2.0