The form model
Form element data is stored in the form model.
The model is an object that contains one model property for each of the form’s elements which have an ID assigned.
Example
Consider this UI builder form
When deployed, a user enters some data.
For this data, the form model can be represented as:
{
"username": "johnsmith"
"email": "john.smith@demoisv.com"
"isActive": true
}
Note
Button has no ID, so there’s no value stored for it in the model. Only properties that are present in the model can be mapped.
The JSON schema that represents the form indicates that the form model is an object that contains three properties: username
(which is a string), email
(which is a string), and isActive
(which is a boolean).
We can also specify that there can’t be any other properties in our form model that are not listed in properties.
{
"type": "object",
"properties": {
"username": {
"type": "string"
},
"email": {
"type": "string"
},
"isActive": {
"type": "boolean"
}
},
"additionalProperties": false
}
Note
For more information about the use of JSON schema for CyberApp mapping, see Mapping - technical reference.