Creating Dynamic Forms Field
Creating a new Dynamic Forms Field.
Navigate to the Administration > Dynamic Forms Field or search for Dyamic Form Field in the Administration menu.
If you cannot find the Dynamic Forms Fields option, verify that you have the /admin/dynamic-forms/fields permission active.
Select +Add New and input the required information: Dynamic Forms Fields
Name: A unique identifier for this field. Should not contain white spaces. This will be used during the dynamic form creation for identify the current field.
Enabled: Dynamic form field is currently enabled.
Disabled: Dynamic form field is currently disabled.
Definition: The schema definition used for render this field in a dynamic form. You can add Regex validation (regular expressions) to the properties of the definition. You can do it manually according to the following considerations:
- ^ is a constant in the expression
- ^STGEO is a constant expressions
- [0-9] a number between 0 to 9
- [0-9]{2} any 2 numbers between 0-9
- [a-z] a letter from a-z
- [a-z]{3} any 3 letters between a-z
- $ close the sequence
- | and/or
Fill in the label translations for the available languages configured in the account.
Fill the enums values translations for the available languages.
Fill in the translations of the message values for the languages available in this case for the custom regex
In order to properly check and process the definition the Process definition button should be clicked. A new section to fill multilang values will be available if you add enum property to the definition
Examples of schema definition
Text field:
{
"type": "string"
}
Field of type list (select)
{
"type": "string",
"enum": [
"opt1",
"opt2"
]
}
Date field
{
"type": "string",
"format": "date-time",
"x-btrz-date": {
"from": "new Date()"
}
}
List type field but getting the data from a collection
{
"type": "string",
"x-btrz-data": {
"collection": "document_types",
"key": "_id",
"value": "lexiconKeys.name",
"ord": "ord",
"default": ""
}
}
Where collection can be: “countries”, “document_types”, etc.
Click Save to save your changes.