Client Survey
| Id | Name (Link) | Surname | Marital Status | Have Kids | Mobile | CreatedBy | Last Updated On |
|---|
1
2
3
...
Requirement: Form and DB Operation 4 - Introduce New Feature (Conditional Field)
This exercise focuses on implementing **conditional UI rendering** and **conditional validation** based on a previous field's value, simulating a business rule.
Database Entity Setup:
- Add a new attribute: HaveKids (Text) to the database entity.
Form Implementation (Dynamic UI):
- The new field, **"Have Kids"**, must be presented as a Dropdown widget with values: Yes, **No**, and **NA**.
- Conditional Visibility: The **"Have Kids"** dropdown must be initially **hidden**.
- Dynamic Rule: When the Marital Status is selected as **Married** or **Separated**:
- The **"Have Kids"** dropdown must become **visible**.
- It becomes a **Mandatory** field (validation enforced).
- Default/Hidden Rule: When the Marital Status is selected as **Single**:
- The **"Have Kids"** dropdown must remain **hidden**.
- The value for this field must automatically be set to **NA** before saving.
- Validation for this field must be **bypassed**.
- Ensure both **Add** and **Edit** functionality correctly save and load the `maritalStatus` and `haveKids` data, respecting the conditional logic.
List Screen Update:
- Add a new column, Have Kids, to the main list screen to display the client's status.
Hint (OutSystems): Conditional visibility is handled using the **Display property** (setting it to `False` or an expression) on the widget, and the change event (`On Change`) of the Marital Status dropdown is used to execute the logic.
Practice with Ankit | Form and DB Operation 4