Logo Practice with Ankit | Form and DB Operation 4

Client Survey

Id Name (Link) Surname Marital Status Have Kids Mobile CreatedBy Last Updated On
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):

  1. The new field, **"Have Kids"**, must be presented as a Dropdown widget with values: Yes, **No**, and **NA**.
  2. Conditional Visibility: The **"Have Kids"** dropdown must be initially **hidden**.
  3. 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).
  4. 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**.
  5. 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.

Ankit G Avatar
About the Author: Ankit Gangrade

Ankit Gangrade is a passionate Low-Code Architect, Developer, & Educator dedicated to helping students and professionals build modern applications faster using OutSystems and Cloud-Native technologies. His goal is to bridge the gap between traditional coding and modern low-code platforms — empowering the next generation of developers to build smart, scalable, and cloud-ready apps.