Array
Entity
Property
Required Metadata
Optional Metadata
Comment
There are multiple ways to stored data as array. Array will have add and remove option in input form. If you want at least one element should require, then you need to add required validation to it. If it is required then one element by default will be available in input form otherwise you need click on add button to add an element.
String Array
Following example showing how to define property for string array which at least one item is required.
"activites": {
"dataType": 'array',
"displayName": "Activities",
"inputType": "text", // text , textarea, number, checkbox , group
"validation": {
"required": true
}
}Json Request object
"activites": ["Footabll", "Swimming", "Singing"]Another way to get predifined string array using checkbox group.
Other way to define string/ number array using inputType select and multiple set to true.
Number Array
It is same as string array just need to change inputType to number.
Group / Object Array
"education": {
"dataType": "array",
"inputeType": "group",
"proeprties": {
"degree": {
"dataType": "string",
"inputeType": "select",
"optionValues": ['BA', 'B.Com', 'B.Sc', 'Engineer' 'MA', 'MCom', 'Msc', 'Phd'],
"validation": {
"required": true
}
},
"university": {
"dataType": "string",
"inputeType": "text",
"validation": {
"required": true
}
},
"year": {
"dataType": "number",
"inputeType": "number",
"validation": {
"pattern": "\^[1-9]{1}[0-9]{3}$\"
}
}
}
}Json Request object
"education": [
{ "degree": "B.Com", "university": "Pune University", "year": 1993 },
{ "degree": 'M.Com', "university": "Mumbai University", "year": 1995 }
]