ASSOCIATE-REACTIVE-DEVELOPER practice question 28 of 35

Consider a Screen that contains a Form to collect Customer dat a. The Form has a Save Button with the On Click Destination set to a SaveOnClick Action, which sends the data to the server to store it in the database. What is the best way to make sure that we do not send the data to the server when the mandatory Customer data fields have not been filled in?

Full set: 262 questions
Answer options
A: Just set the Built-in validations of the Save button to Yes.
B: Perform custom validations for all inputs. If one fails, set the Valid property of the Form to False.
C: Set the Built-in validations of the Save button to Yes and check if the Form's Valid property is True. Correct answer
D: Set the Built-in validations of the Save button to Yes and add an Exception Handler flow to handle invalid inputs.
Correct Answer:
C. Set the Built-in validations of the Save button to Yes and check if the Form's Valid property is True.
Explanation

The most effective and standard method in Outsystems Reactive Web Apps is to leverage the built-in validation mechanism. Setting the Save Button's Built-in validations property to Yes triggers the platform to automatically check all inputs within the Form for validity (e.g., mandatory fields). The result of this check is stored in the Form's Valid runtime property. The client action associated with the button must then use an If condition to check if Form.Valid is True before proceeding to call the server action. This two-step process ensures that invalid data is caught on the client-side, preventing unnecessary server requests and providing immediate feedback to the user.

Why Incorrect

A. This is incomplete. Setting Built-in validations to Yes only triggers the validation; it does not, by itself, stop the execution flow from calling the server action.
B. This is incorrect and inefficient. Outsystems provides automatic validation for mandatory fields. Manually setting an input's Valid property is for custom logic, not for standard mandatory checks.
D. This is a misuse of the feature. Built-in validation failures do not raise exceptions; they update the Valid property. Exception Handlers are for managing unexpected application errors, not for form validation logic.

References

1. Outsystems Official Documentation - "Validate form fields in Reactive Web Apps": This guide explicitly details the correct pattern. It states, "Set the Built-in validations property of the Button to Yes." and then instructs to, "Add an If element to the logic flow to check if the form is valid. Use the Form.Valid runtime property in the Condition."

Source: Outsystems Documentation, "Validate form fields in Reactive Web Apps", section "Client-side validation".

2. Outsystems Official Documentation - "Form Widget": This document describes the Valid runtime property of the Form widget. It clarifies that Valid is a "Boolean that indicates if the data of the Form inputs is valid or not." This property is what must be checked in the logic.

Source: Outsystems Documentation, "Widgets in Reactive Web and Mobile Apps", section "Form Widget > Runtime Properties".

3. Outsystems Official Documentation - "Button Widget": The documentation for the Button widget explains the Built-in validations property: "If Yes, the Form inputs are validated when the User clicks the Button." This confirms the first step of the correct process.

Source: Outsystems Documentation, "Widgets in Reactive Web and Mobile Apps", section "Button Widget > Properties".

Scroll to Top