Skip to main content

Custom Form

since app build #3

If the item "formData" is defined in settings, the application renders a custom form for collecting extra information with each code scan. It loosely follows the jsonform specificaiton.

Sample formData format#

{  "formData" : {    "schema": {      "length": {        "title": "Track Length in km",        "type": "integer",        "enum": [ 50,90 ]      }    },    "showOnce" : false  }}
  • schema - Object that describes the data model
  • showOnce - If present and set to true, the custom form is not stored (persisted) and shows just once
  • formOrder - ["beforeScan"|"afterScan"] defines if the custom form is shown before code is scanned, or after

Schema items#

Schema items the actual form fields defined as keys of the "schema" key. These form fields are supported:

  • radio buttons (only one option of multiple is selectabe)
  • text field (regular text field)

Radio buttons format example#

This schema shows two form fields:

  • radio button group for choosing gender
  • radio button group for choosing track length
{  "schema": {    "gender": {      "title": "Please select gender",      "type": "string",      "enum": [ "male","female","other" ]    },    "length": {      "title": "Track Length in km",      "type": "integer",      "enum": [ 50,90 ]    }  }}

Limitations#

The length of form fields is not limited, but the forms do not scroll if they overflow the visible area of the device.

Screens workflow#

Please visit the screens diagram page for more information