[New Feature] Option sets

Thanks, Cal -

Wondering if there are any plans to include dynamic option sets attributes or app text values.

One use case would be to allow for faster page loads with universal data.

Right now, we have to do a search:first item for a database entry to load any dynamic SEO, images, text content, etc. It takes time.

If we had this data available without search via app text or option set, we’d be able to load faster and still have dynamic control of each page’s content and SEO tags.

2 Likes

The point of Option Sets is that they are not dynamic. They are for values that are not going to change. They are able to be fast for that reason.

For example, a drop-down with Monday, Tuesday, Wednesday, etc. It’s highly unlikely you are going to need to insert a value for Blarfsday. So that list will be super fast, since it’s static, and doesn’t require a database.

For everything else, create a table, optimize for speed as best you can, and when that fails budget (if possible) to upgrade your plan.

2 Likes

Option Sets are fast, and that’s great. So are App Text records.

Do a search takes time, even for tables with one entry- even on a dedicated cluster.

Allowing apps to dynamically access and edit the attributes would open the door to dynamic page content without need to do a search on page load.

2 Likes

So they’ll be able to read/see the role (i.e. “admin”, “superAdmin”) but unable to change it. Gotcha :+1:

Making them dynamic defeats its purpose and would probably make it slow. They are fast because static data is rendered and Bubble doesn’t need to query the database.

This is probably outside the scope of this feature, but it does nudge on a next idea: allow use of option sets for styles (or something like it).

What do I mean? With option sets I can now list all my app’s colors to give myself the right amount of constraints:

But in the Styles tab, where I would most need this crutch, I don’t have access to them.

7 Likes

Is there a way to use Option sets with multiple options?
Looks like we only can choose 1 option or them all right now.
I’m trying to give users check boxes to select multiple options. Can that be done with this new feature?
Thanks and keep up the great work!!

An option can have multiple attributes. An attribute can have many different types; one of them being another option. These attributes can also be a list.

Would that be useful?

@bcronin7
My birthday is on Blarfsday, so I’m offended by your comment.

5 Likes

Any chance we can upload data to Options set using a csv file?

5 Likes

Any way you could do an updated tutorial with Option Sets for your VIP members?

+1 on this.

I have 7 breakpoints I use to make things responsive. I have to add each breakpoint to the conditionals ib every text style and on many other elements (inside and outside styles). It would be a huge timesaver to have have breakpoint sizes as an option set and simply refer to them both within and without styles.

This is a great new feature! I am trying to figure out the best way to convert my existing data into an Option set. I have text fields/data types that are now the “Display” in the Option sets. However, there does not seem to be a “Search For” Option sets to be able to use the Option set display in order to convert the data in bulk.

Does anyone have any ideas? Thank you!

@cal @Jici

You don’t have to search for them, they are just there. Like environment variables… which is what they are. Get it?

2 Likes

Thank you @Keith. I am just trying to use a one-time API call to convert all of my existing data. I need to be able to dynamically select which Option to assign based on my existing text field. If I was starting from scratch, this would be fine, but trying to convert a text field that says “Regular User” or “Admin User” into a option set with a display of either “Regular User” or “Admin User”

I guess my question could be simplified by how to define which Option to use when creating an item via API. Do you just use the display name in the JSON payload? Are there option IDs?

@keith

@bhage, you may be better served using the built in Bulk Action under the editor data tab.

Here’s a link to the reference:

I’ve got a bunch to move around now ^^’

What is the performance of Options sets if there are a lot of options (like hundreds).

Are they downloaded to the client’s browser? Or they live on the server?

Just wondering, if there are a lot of options for an option set, whether I’d be better off storing them on the DB, even if accessing them is a bit slower.

Thanks!

I’m certain using option sets would be much faster. Yes they download each time, but thousands of options are still only tiny bits of text, likely smaller than most basic images. And they are immediately available, which is always better than slow loading lists.

1 Like