Validation
Validation in App Studio ensures that users provide correct and complete information before submitting data. By defining validation rules on input components, you can prevent errors, improve data quality, and provide clear feedback to users about what's expected.
To set up validation rules, use:
- Validation menu: Define validation rules directly in components using their validation properties.
- Triggering validation: Use the Field validation action to check all validation rules before sending data.
Validation menu
The Validation menu is available in some components to allow you to define validation rules in your app.

The following table shows the validation properties for each component.
| Properties | Components |
|---|---|
| Optional field | Drawing area, Dropdown, Combobox, File uploader, Radio, Text area and Text input |
| Choose common pattern | Text input Note: Only for Text, Phone number, Email, URL, Password and Search Types. |
| Additional validations | File uploader, Radio, Text area and Text input |
Optional field
By default, all components are required in all instances. You can use Liquid templating to add a rule to specify when the component should be required. If the user fails to fill in the component, a default message is displayed. You can also, enter your own message.
You can turn on the Optional field property to make the component optional.
The following table describes the properties available to add rules for required fields:
| Property | Description | Required |
|---|---|---|
| Add rule | Add rules in Liquid JS to specify when the component is required. If no rules are set, the component will be required in all instances. | No |
| Message | Enter a message to be displayed if the user does not fill in the input. A default message is otherwise shown. | No |
Choose common pattern
Select a validation pattern from the Choose common pattern drop-down menu to define the expected input data type for your field. See Available common patterns for more details.
If the user input does not match the selected pattern, the component automatically displays a default validation message.
Note: if overlapping validation conditions occur, then the hierarchy is: Required > Common pattern > Error > Warning > Informative.
The following table lists the available common pattern options and the defined regular expressions for them:
Note: Only for Text, Phone number, Email, URL, Password and Search Types.
Example: Validating a numeric input with Digit pattern
When using the Text input component with the Type property set to Number, the HTML5 <input type="number"> allows exponential notation (for example, 2e4), negative numbers, and floating-point numbers according to browser implementation. To restrict input to digits only and validate against characters like exponential notation:
- In the Styles menu, set Type to
Text. - In the Validation menu, select Choose common pattern as
Digit. - If the user enters invalid input such as
2e4, an error message is displayed. - Use the Field validation action in the Logic map to prevent sending requests when the input is invalid. See Field validation for more details.
Note: Only the properties relevant to the example are explained. See the Text input component for more details.
Additional Validations
For components that allow additional validations, you can add rules using Liquid templating.
| Property | Description | Required | |
|---|---|---|---|
| Additional validations | Select any or all checkboxes to add validations. | No | |
| Error | Select the checkbox to add a red error style validation to the component. | No | |
| Add rule | Add rules in Liquid JS to specify when the error validation is shown. | Yes | |
| Error message | Enter a message to be displayed if the user fills in the input incorrectly. | Yes | |
| Warning | Select the checkbox to add an orange warning style validation to the component. | No | |
| Add rule | Add rules in Liquid JS to specify when the warning validation is shown. | Yes | |
| Warning message | Enter a message to give the user advice on how to better fill in the input. | Yes | |
| Positive | Select the checkbox to add a green positive style validation to the component. | No | |
| Add rule | Add rules in Liquid JS to specify when the positive validation is shown. | Yes | |
| Positive message | Enter a message to tell the user that the input has been correctly filled in. | Yes |
Note: if overlapping validation conditions occur, then the hierarchy is: Required > Common pattern > Error > Warning > Informative.
Triggering validation
To perform validation before sending data, you must use the Field validation action than can be configured in a Button component.
When the Field validation action is executed, it checks all validation rules defined on the selected input components (required fields, common patterns and additional validations). If any validation fails, the corresponding error messages are displayed and the data submission is prevented.
For more information on configuring the Field validation action, see Field validation.
Example: Validating date input before sending data
To validate a Text input component with a date format before sending data using the Field validation action, follow these steps:
Step 1: Configure the Text input component
- Add a Text input component to your Canvas.
- In the Main menu:
- Set Component ID to
dateInput(or any unique identifier). - Set Label to
Enter date. - Set Placeholder to
MM/DD/YYYY. - In the Styles menu:
- Set Type to
Text. - In the Validation menu:
- Keep the Optional field switch turned off to make the field required.
- From the Choose common pattern drop-down, select
Date: mm/dd/yyyy. - Optionally, add a custom Message such as "Please enter a valid date in MM/DD/YYYY format".
Step 2: Add a Button component
- Add a Button component to your Canvas.
- In the Main menu:
- Set Component ID to
submitButton. - Set Label to
Submit.
Step 3: Configure the Field validation action
- Select the Button component.
- In the bottom-right corner, open the Logic map tab.
- In the Logic drawer on the left, locate the On click event and the Field validation action and drag them to the viewport.
- Connect the On click event output port to the Field validation action input port.
- Select the Field validation action node to configure its properties in the panel to the right:
- In Description, optionally enter "Validate date input".
- In Fields, select the Component ID of the field you want to validate from the drop-down list. For this example, select
dateInput.
Step 4: Add the HTTP Request action
- Drag an HTTP Request action from the Actions section and drop it into the viewport.
- Connect the green output port of the Field validation action to the HTTP Request action input port.
- Configure the HTTP Request action:
- Select your configured HTTP resource that sends the data.
- Configure any additional properties as needed.
Step 5: Optional - Add error handling
- Drag a Toast action to the viewport.
- Connect the red output port of the Field validation action to the Toast action input port.
- Configure the Toast action:
- Set Variant to
Negative. - Set Title to "Validation failed".
- Set Message to "Please correct the date format before submitting".
Result:
When the user selects the Submit button:
- If the date input is valid (matches the MM/DD/YYYY format), the green output port is triggered and the HTTP request is sent.
- If the date input is invalid or empty, the red output port is triggered, the error message is displayed on the component, and the HTTP request is not sent.
Note: Only the properties relevant to the example are explained. See Field validation and HTTP Request for complete property details.