Required Attribute¶
The required
attribute is used on a field elements to indicate that a field must be filled out before form submission. It is a Boolean Expression attribute, meaning that if it's present on an input element and evaluates to true, the field is considered mandatory.
Key Behavior
- Applies to
Entity Attribute
,Field Element
. - Prevents form submission if the field is empty or has no valid value.
- Triggers the browser’s built-in validation UI (e.g., message saying "Please fill out this field").
- Does not override
readonly
, those fields are ignored during validation.
Important: If required
is set on the entity attribute, the layout field cannot override and revoke it. This ensures that data integrity rules at the model level are always enforced, regardless of UI configuration.
Conditional¶
Required is of type Boolean Expression
which means that it can be either static true
or false
, or conditional. See Conditional Syntax for details.
Required Attributes in Assistants¶
By default, a field marked as required in an assistant will appear as mandatory in the UI, but it will not enforce that a value must be entered unless validation is explicitly enabled.
In the legacy design of Assistants, step validation was manually defined on the Next and Finish commands. Later, a generic framework-based validation mechanism was introduced. When Step Validation is enabled, the framework automatically evaluates required fields and field-level validations, and accordingly controls the Next and Finish buttons.
Due to backward compatibility constraints, this option cannot be enabled by default for all existing assistants. Therefore, developers must explicitly enable Step Validation to activate this behavior.
Step Validation - This is an optional attribute on the Assistant element.
To enable it:
- In Page Designer on the assistant element, click (...) to toggle optional attributes visible.
- Set
Step Validation
to 'Enabled'
Important: For the same reason that Step Validation cannot be enabled by default, you should not assume that enabling it will work seamlessly with existing assistants. In some cases, it may not be possible to add a required custom attribute or mark a standard field as required in an existing assistant. This is a known design limitation.