/outsystems-tutorials

How to create dynamic dropdowns in OutSystems that filter options based on prior selections?

Learn to create dynamic dropdowns in OutSystems that filter based on prior selections, enhancing user interaction and data accuracy in your applications.

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 create dynamic dropdowns in OutSystems that filter options based on prior selections?

Creating Dynamic Dropdowns in OutSystems

 

Creating dynamic dropdowns in OutSystems to filter options based on prior selections is an essential feature for developing interactive and user-friendly applications. This guide outlines a comprehensive, step-by-step approach to achieving dependent dropdown functionality.

 

Prerequisites

 

  • An active OutSystems account with access to a development environment.
  • Basic understanding of OutSystems Service Studio interface and reactive web applications.
  • Knowledge of Entity and Aggregate creation in OutSystems.
  • Familiarity with variables and expressions in OutSystems.

 

Understanding Dynamic Dropdowns

 

  • Dynamic dropdowns display a list of options that adapt based on user interactions or selections in a previous dropdown.
  • They enhance the user experience by providing relevant options, reducing data entry errors, and refining data capture efficiency.

 

Setting Up Your Data Entities

 

  • Log in to your OutSystems environment and open or create the desired application where dynamic dropdowns are required.
  • Create two or more entities to represent your dropdown data. For example, a "Country" entity and a "City" entity.
  • In the "City" entity, include an attribute to establish a relationship with the "Country" entity, often a "CountryId" foreign key.

 

Constructing the Dropdown UI in OutSystems

 

  • Open the page where you want to add the dynamic dropdowns.
  • Drag and drop a Dropdown widget from the Toolbox onto the page for the first dropdown (e.g., "Country").
  • Bind it to a List of your first entity (e.g., Countries) using an Aggregate to fetch data.
  • Bind the selected value from this dropdown to a local variable (e.g., SelectedCountryId).

 

Implementing the OnChange Event for Dependency

 

  • Select the first dropdown and navigate to its Events tab in the properties panel.
  • Assign an OnChange event to this dropdown. This action will be triggered whenever the user changes the value.
  • Create a new client action associated with this event to update the options of the dependent dropdown.

 

Configuring the Second Dropdown

 

  • Add another Dropdown widget to the page for the dependent options (e.g., "City").
  • Configure it to source its data based on the selected value from the first dropdown. This is done by applying a filter in the Aggregate: use the condition "City.CountryId = SelectedCountryId".
  • Set this dropdown's data source to the filtered Aggregate, updating the List whenever the first dropdown changes.
  • Bind its selected value to another local variable (e.g., SelectedCityId).

 

Testing Your Dynamic Dropdowns

 

  • Publish and preview the application to ensure the dynamic dropdowns work correctly.
  • Select a value in the first dropdown and observe the options in the second dropdown updating accordingly.
  • Test different combinations to validate the specific options are correctly updated based on selections.

 

Enhancements and Best Practices

 

  • Ensure efficient application by limiting the data fetched in Aggregates to relevant entities or rows only.
  • Maintain a consistent user experience by using loading indicators when fetching data dynamically.
  • Handle special cases, such as what happens when no option is available or selected in prior dropdowns.

 

By following these steps, you can effectively create and manage dynamic dropdowns in OutSystems that react to earlier user inputs, enhancing both functionality and user engagement within your applications. This approach not only leverages the power of the OutSystems platform but also drives improved data integrity and cohesive user interactions.

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