How to make dropdown select options yes/no

Hello there,

I try to create dropdown which has 2 options: yes/no. And as I understand it also is better to use “yes/no” format for database. So, in this case I use dynamic choices for the dropdown (with static it works, but text value is not acceptable for db).

So, guys what I can’t do

  1. I can’t show the options in dropdown
  2. I can’t show “yes” by default

screenshot-rsvp-46456.bubbleapps.io-2023.05.30-11_40_46

Thanks

2 options…

  1. Just use static text values (yes and no) - then in your workflow you can store the yes/no value as dropdown’s value is “yes”.

  2. Create an Option Set, with 2 options (yes and no), and set a yes/no attribute on them. Then in your workflow you can store the yes/no value as dropdown’s value’s yes/no

1 Like

Thank you, but I did it before. And I need to use “yes/no” field type in my db, because in future I need to work with records which contain only “yes”. And I was stuck when I used text format field for “yes/no” because I had not found opportunity to filter these records.
I found the possibility to filter by boolean “yes/no”

Adam, I haven’t got “store the yes/no value as dropdown’s value is “yes””

I created addditional dropdown (dropdown B) to test it and created a new custom statement “yes/no”, but the data are not stored in database

or you mean to use the following way, but how to select yes/no?



Uploading: 30-05-2023 12-43-56.jpg…

  1. Create option set in Data with attributes Val (type=yes/no).
  2. Add too item (yes and no) and in modify attribute Val (in yes - yes, in no - no)
  3. In dropdown use type of choices - yes or no and in choices source write All yes/no:each item’s val

I did so, but it does not work
It does not work, dropdown is empty

screenshot-rsvp-46456.bubbleapps.io-2023.05.30-13_10_01


Uploading: Screenshot_5.png…

If you use static values (yes and no) as per Adam message, in your second screenshot, value should be: “Dropdown B’s value is “yes”” , with “yes” being a text value based on your dropdown’s static values (“yes” and “no”).

If the Dropdown B’s value is yes, it will return a yes in a “yes/no” Bubble format. If not, it will return a no.

Here’s a simple working example showing how to do both methods I described to save a value to a yes/no field in the database.

The first method just uses static text values in the dropdown.

The second method uses an option set.

For what it’s worth, if you’re only using this type of dropdown once in your app, then using static text values is probably simpler. If you have many yes/no dropdowns across your app, then an Option Set will make things easier.

Save Yes No (bubbleapps.io)

That’s why I showed the dropdown list as I hoped to find “yes” but it’s not in the list

Source is empty! Set source.

You have to directly type the same text value as in your dropdown static values (see Adam’s second reply with an app example), and not use Bubble’s dropdown list.

Thanks, Adam
This is almost the same as Timur described.
But it seems in the workflow I asked to add something more
my “val” = your “Yes/no”

screenshot-bubble.io-2023.05.30-14_04_07

screenshot-bubble.io-2023.05.30-14_04_52

I tried three types of data but they are not recorded into the table

screenshot-bubble.io-2023.05.30-14_13_26

This issue checker will tell you what you’re doing wrong - but clearly you’ve got a type mismatch between the DB field type and the value type you’re setting.

Check the issue checker to see what you need to do.

I can’t understand the problem. I created the field in db as Yes/No type, but in workflow i asked for more attributes to select

screenshot-bubble.io-2023.05.30-18_19_34

screenshot-bubble.io-2023.05.30-18_22_06

it should be of type yes/no not Yes/No - unless, that is, you’re using the dropdown’s Yes/No value (instead of the Yes/No value’s yes/no value)?

f…ck, I am confused

If i change all here, the other data is broken

Did you look at my example? It’s simple…

1 Like