Dropdown Yes/No

When using the dropdown element and making type of content Yes/No it should automatically have those two values as the choices source and should actually enable a selection so that the selected value would result in the dropdown having a value that would be equal to a yes/no data type.

6 Likes

Create you Option set with your own boolean field. Set “Display” to “yes” and value to “yes” (boolean). and Display to “no” and value to “no” (boolean). And you are all set!

1 Like

I’ll give it a try

This doesn’t work to allow us to set an initial content on a dropdown that would be the same as a datafield on the data type in the database.

Actually you can, but it is a big “loop”… Maybe not worth in some situations.

Here is how I did it:

  1. added option type called “Dropdown yes/no” with 2 entries (yes, no) and for each a value (yes, no) of boolean
  2. made the dropdown using the Dropdown yes/no type (both options appear)
  3. default value is tricky… getOption(Dropdown yes/no):filter(value=database.value):first_item

If the database field is yes/no type, then you can’t do auto-binding as this isn’t of the same type.

Otherwise, using the “change” event, just update with This Dropdown.value.value and you will get your yes/no value correctly.

1 Like

Yes, I was able to set the default value in a similar way but I was not actually able to do it as simply as would have been preferable.

Main reason for the idea was to make it so it is more straightforward and easy to implement rather than needing to perform more complex than necessary ‘work arounds’ for what I would consider a missing feature.

Thanks for your help.

1 Like

What you want is a “hack” that “transfigures” the “checkbox” into a “select” on the DOM upon page load.

I know how to do that, but don’t have the time now to go further then point you in the direction:

  1. set the “id” of the checkbox
  2. add RunJS element on page load (if you use HTML element, it also works with the script tag)
  3. on Javascript:
    • Find the element of checkbox
    • Create a new dropdown () element
    • replaceChilds placing the dropbox element on the element of the checkbox

Eventually it will break somewhere else, but I’ve found that you can always go around and “force/decieve” bubble in the weirdest situations.

1 Like

Today I came across this same challenge, changing a Boolean field through a Dropdown.
The solution I found was the following:

I created two fields in the table. They receive the same information, but one is text type and the other is Boolean type.

The first field, text type, receives the “Yes” or “No” from Dropdown.

The second field, boolean, receives the yes or no from a checkbox. This checkbox is hidden and has two conditionals, which are changed according to the choice made firstly in Dropdown.

The first conditional says that when the dropdown choice is yes, the checkbox is checked. The second conditional says that when the dropdown choice is no, the box is unchecked.

Both Fields on database receive a Yes or No, both text and Boolean come with the same information, which makes it easier later on, if you need to edit them, that is, they will always have the same value, just repeating this logic, when a workflow for editing is created.