Using Option sets in dropdown

Option sets are basically a static list of choices that are global to your app. You just have to define them once and use them wherever you need a custom data type.

They behave like a Data type of their own, but are significantly faster to load. You can use Option sets with dropdowns, radio button or even use them to create a menu in your Bubble app.

The most common place where you’d use them is with Dropdowns.

Defining the Option set

Creating an Option set is easy. It is quite similar to the way you create a new Data type and its Fields.

To create or view an Option set, go to the Data tab of your applications. Then open the Option sets subtab. You’ll be able to see all your Option sets over here and edit them.

To create a new Option set, give it a name and click Create button. For this tutorial, I’ll be creating a new Option set called Subscription Plan with 4 choices. Each choice will also store a few attributes (fields).

An Attribute is similar to a Field in a Data type. You can define an attribute to hold a certain value and use it wherever the Option set is being used. I have added some attributes which I can use later on for custom logic.

For example each Subscription status has an attribute “No of users”. I can apply a check on a workflow when they are inviting new users to run the workflow only when Current User’s Subscription Status No of Users < Current User’s Invited Users.

Using Option sets as choice source in dropdown

Create a dropdown and change the Choice style to Dynamic. We don’t need a static Choice style. The Type of Choice will be the name of the Option set.

You now have a dropdown with Dynamic data source and the choices of this dropdown can be conveniently updated from the backend.

The biggest benefit of using Option sets is that they are faster to load as compared to fetching data from Data types. And instead of having to manually update every dropdown whenever you want to change the choice source, you can update them once and all the dropdown will be automatically updated.

Related

How to use Option sets

How to create a dropdown that filters another dropdown

If you need some help with your Bubble app or if you need a team of Bubble developers to build a Bubble app for you, reach out to me at himanshu@nocodeassistant.com. You can also follow me on Twitter.

--

--

--

I help people bring their ideas to life with Bubble. http://nocodeassistant.com/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Complete Web Developer — Zero to Advanced

Send and verify OTP using firebase cloud function in flutter.

JavaScript Intro Part 2 : Variables

Week 2 blog post

Generating Sitemap Entries For Nuxt Content

Logical CSS with Simple Styled Components Mixins

https://t.co/iUXvtywuM5

THE CORE CONCEPTS OF JAVASCRIPT

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Himanshu Sharma

Himanshu Sharma

I help people bring their ideas to life with Bubble. http://nocodeassistant.com/

More from Medium

Admin privileges and access

Top Digital Trends for Ecommerce Stores in 2022

Automating Processes in Blood Operations Saves More Than Money

PROCESIO February 2022 Community Updates