/outsystems-tutorials

How to handle optional form fields in OutSystems so they appear only when needed?

Learn to conditionally display optional form fields in OutSystems for streamlined user interfaces. Follow this step-by-step guide to enhance your app's functionality and user experience.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your website? RapidDev builds Webflow websites with your growth in mind.

Book a free No-Code consultation

How to handle optional form fields in OutSystems so they appear only when needed?

Handling Optional Form Fields in OutSystems to Display Conditionally

 

OutSystems provides dynamic control over UI elements, including form fields. This allows developers to conditionally display optional fields based on certain user interactions or data conditions. This guide will help you achieve that through an exhaustive step-by-step approach.

 

Prerequisites

 

  • An OutSystems account with access to a project where you want to set up conditional form fields.
  • Basic understanding of OutSystems elements like screens, widgets, and expressions.
  • Familiarity with creating and modifying logic flows in OutSystems represented as actions and conditions.

 

Understanding Conditional UI in OutSystems

 

  • Conditional UI rendering in OutSystems typically relies on boolean expressions or logic to show or hide elements.
  • This can be achieved using variables, expressions, and actions to determine when a form field should be visible.

 

Setting Up Your Screen with Form Fields

 

  • Open your OutSystems project and navigate to the module containing the screen where you want to implement conditional fields.
  • Drag and drop the Form widget onto the screen from the Toolbox.
  • Add your standard form fields to the Form widget.
  • For the optional field(s), consider using Input Widgets that you might want to conditionally display.

 

Creating a Variable to Control Visibility

 

  • In the Interface tab, select the screen where your form resides.
  • Right-click on Local Variables (or use the shortcut to add a new one) and create a new Boolean variable, e.g., `ShowOptionalField`.
  • Set the initial value of this variable based on your desired default state (true if the field should be visible initially, false otherwise).

 

Implementing Logic to Toggle Visibility

 

  • Identify the user interaction or data-driven scenario that should toggle the visibility of your optional field.
  • For example, if clicking a checkbox should reveal another field:
    • Add a checkbox to your form.
    • Bind an OnChange client action to it.
    • Within this action, set the `ShowOptionalField` variable to toggle its value (e.g., `ShowOptionalField = CheckboxChecked`).

 

Binding the Visibility Condition to the Form Field

 

  • Select the optional field you want to show or hide.
  • Find the Visibility property in the properties pane.
  • Set it to an expression based on your boolean variable, e.g., `=ShowOptionalField`.

 

Testing the Conditional Logic

 

  • Use the "1-Click Publish" feature to deploy your changes to the development environment.
  • Access the form through the application interface.
  • Test the interaction(s) that should trigger the conditional display of your optional fields.
  • Verify that the fields hide/show according to the logic you implemented.

 

Refining and Deploying the Application

 

  • Review your logic for any edge cases or additional conditions you might want to implement.
  • Once satisfied, publish your application to a higher environment or to production.
  • Ensure thorough testing in the target environment to validate the conditional field's behavior across all use cases.

 

By following this detailed approach, you can efficiently handle optional form fields in OutSystems, ensuring they appear only when necessary. This not only improves the user experience by keeping forms simple and uncluttered but also enhances the functionality of your applications.

Explore More Valuable No-Code Resources

No-Code Tools Reviews

Delve into comprehensive reviews of top no-code tools to find the perfect platform for your development needs. Explore expert insights, user feedback, and detailed comparisons to make informed decisions and accelerate your no-code project development.

Explore

WeWeb Tutorials

Discover our comprehensive WeWeb tutorial directory tailored for all skill levels. Unlock the potential of no-code development with our detailed guides, walkthroughs, and practical tips designed to elevate your WeWeb projects.

Explore

No-Code Tools Comparison

Discover the best no-code tools for your projects with our detailed comparisons and side-by-side reviews. Evaluate features, usability, and performance across leading platforms to choose the tool that fits your development needs and enhances your productivity.

Explore

Bubble Integrations

Dive into our comprehensive resource for Bubble.io integrations, featuring expert advice, detailed tutorials, and FAQs. Whether you're a beginner or an experienced developer, find everything you need to seamlessly integrate third-party services with Bubble.io.

Explore

Successful Bubble.io Projects

Explore a curated showcase of successful Bubble.io projects and see what's possible with no-code development. From innovative apps to complex systems, discover inspiring examples that highlight the power and versatility of Bubble.io. Start envisioning your next project today!

Explore

Flutterflow Tutorials

Explore our detailed directory of FlutterFlow tutorials to master mobile app development without coding. Gain insights through step-by-step guides, practical examples, and expert tips to efficiently use FlutterFlow and build stunning apps.

Explore

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022