BaseField
Base model from which the form fields inherit their properties.
Interface
interface IBaseField {
name: string;
label: string | ILocales;
type: FieldType;
description?: string | ILocales;
condition?: string;
visible?: boolean;
validation?: IValidation;
value?: any;
placeholder?: string | ILocales;
disabled?: boolean;
errorMessage?: string;
audience?: string[];
}
Properties
name
Internal field name.
-
Type:
string
-
Required: Yes
type
Specifies the type of field to display.
-
Type:
FieldType
-
Required: Yes
label
Text to be displayed just above the field that is compatible with this property.
-
Type:
string |
Locales
-
Required: No
description
Description of the field.
-
Type:
string |
Locales
-
Required: No
condition
If the condition is not met, the field is not displayed. Below are the types of conditions that can be used:
If a field is valid:
"{name}.valid"
If a field has a certain value:
"{name}.value=communicationSite"
If a field has a certain array of values:
"{name}.value.0.text=Idea"
It is also possible to nest conditions using ”&&”:
"isMeeting.value=true&&isZoomtypeMeeting.value=true"
-
Type:
string
-
Required: No
-
Example:
"condition": "description.valid"
"condition": "siteType.value.key=communicationSite"
"condition": "category.value.0.text=Organizational"
visible
If false
, this element will be removed from the visual tree. Also support conditional in string format ("true" | "false"
).
-
Type:
boolean | string
-
Required: No
-
Example:
"visible":false
"visible": "@eval({base.title} && !{base.description})"
validation
Set of properties to establish a specific validation rule.
-
Type:
Validation
-
Required: No
-
Example:
"validation": {
"required": true,
"expression": "/^[^0-9]+$/",
"expressionErrorMessage": {
"en-US": "You can not use numbers in this field",
"es-ES": "No puedes usar numeros en este campo"
},
"minLength": 5
}
value
You can specify the value of the field.
-
Type:
any
-
Required: No
placeholder
Placeholder that will be displayed in the fields that support this property.
-
Type:
string |
Locales
-
Required: No
disabled
Indicates if the field should be disabled.
-
Type:
boolean
-
Required: No
errorMessage
Error message that will be displayed in the field if it does not meet the validation.
-
Type:
string |
Locales
-
Required: No
audience
Allows you to apply audience to a field indicating an array with the IDs of the AD and Microsoft 365 groups that can view the field.
-
Type:
string[]
-
Required: No
-
Example:
"audience": [
"1da95789-7726-4a2f-a70c-43d2f440c791",
"3da95789-7726-4a2f-a70c-43d2f440c792"
]