Common Properties
These are the common properties of a field (inside the meta
field).
Field | Data Type | Default Value | Description |
---|---|---|---|
name | string | None | Unique field name, this field is a required field for each type of input |
className | string | None | Pass classname for custom styling or reference |
displayName | string | None | Used to display the name of the field in the form |
displayType | string | None | Determines the field type to be displayed. Supported options: |
htmlProps | object | None | Sets native HTML attributes for basic form controls like text_field , select , number , password , email , etc. Example attributes: step , min , max for number . You can use overrideDynamicSupport to override default behavior of dynamic options support |
value | string / boolean / number / array | None | The value of the field |
validation | object | None | Defines field validation |
readOnly | A readonly field is not editable and value cannot be changed | boolean | |
dependencies | object | None | Defines relationships and dependencies between various fields |
Field Properties - Validation Details
The validation settings within the Code component are crucial for ensuring that user input meets specific requirements. Here’s a breakdown of the available validation properties:
Property | Description |
---|---|
required | Boolean value that specifies whether entering data into the field is mandatory. |
infoDetail | Provides additional information related to the field. Can be used to display messages like hints or guidelines to users. |
requiredDetail | Contains the specific properties related to required validation, such as custom error messages. |
minLength | Specifies the minimum number of characters allowed in the input. |
maxLength | Specifies the maximum number of characters allowed in the input. |
min | Specifies the minimum value allowed for number inputs, with support for dynamic values. |
max | Specifies the maximum value allowed for number inputs, also supporting dynamic conditions. |
pattern | A regex pattern that the input must match to be considered valid. |
validate | A function for custom validation logic, which can return a boolean or an error message. |
Example Usage of Validation Properties
required
This property is straightforward; if set to true
, the field must be filled out. This is critical for ensuring data completeness.
"validation": {
"required": true
}
infoDetail
Use this to provide a message that can assist or guide the user in filling out the field correctly.
"validation": {
"infoDetail": {
"infoMsg": "Enter a valid code snippet following JavaScript ES6 standards."
}
}
requiredDetail
Allows for a custom error message that will be displayed when the required condition is not met. This helps in providing a more context-specific feedback to the user, enhancing user experience.
"validation": {
"required": true,
"requiredDetail": {
"errorMsg": "Integration name cannot be empty. Please provide a valid name."
}
}
Example of Validation
"validation": {
"required": true,
"pattern": "/^[a-zA-Z0-9]+/",
"min": 5,
"max": 10
}
Dependencies Properties
Field | Data Type | Default Value | Description |
---|---|---|---|
conditions | array | None | Defines the conditions for the field to be displayed. Each condition is an object containing field , value , and operator |
field | string | None | The field on which the current field depends |
value | string | None | The value of the field on which the current field depends |
operator | string | None | The operator to be used for comparison (e.g., EQUALS , NOT_EQUALS , GREATER_THAN , LESS_THAN , GREATER_THAN_OR_EQUALS , LESS_THAN_OR_EQUALS , CONTAINS , NOT_CONTAINS , END_WITH , START_WITH , EMPTY , NOT_EMPTY , REGEX , NOT_REGEX ) |
Example of Dependencies
"dependencies": {
"conditions": [
{
"field": "country",
"value": "USA",
"operator": "EQUALS"
},
{
"field": "age",
"value": "18",
"operator": "GREATER_THAN"
}
]
}