829
Views
4
Comments
Solved
How to create a dropdown with custom text option?
Application Type
Reactive
Service Studio Version
11.53.11 (Build 61107)

Hi, I am trying to create a dropdown control that includes an "Other" custom text option. I have looked at various answers here in the forums, maybe I am just not using the right words. These are some of the posts I've already checked out:

  • Is it possible to add costom list to dropdown without any entity? if yes then how? | OutSystems  (not really sure what this one is doing)
  • Custom dropdown | OutSystems  (not what I'm looking for)
  • Need to add custom option-text as "Y" in Dropdown. | OutSystems  (seems closest, but not quite)

What I want is to be able to have a dropdown control tied to a static entity (or however it might have a predetermined number of options). Once I select the dropdown control, it should list the options, as well as an "Other" option:

Once the user selects "Other" I would like the option for them to type in some custom text. That should then save to an entity (see "OtherDesc" in the .oml below), which should record the foreign key of the table its from (1 to 1, extension table?) as well as the actual custom text provided by the user. (Note: in my oml I do not have an extension table; rather, I have a central table that would take "OtherDesc" from multiple tables - feel free to add any input on that, but I am researching that separately and may ask in a different question).

Thank you for any help or suggestions!

OtherCustomText_v1.oml
2023-02-09 17-26-57
JD136
Solution

Thank you @Shriyash Dixit for your example. There were a few issues with yours (e.g. once the custom text input was showing, then it wouldn't hide again if I picked something else). I did work this out. 

You'll have something like this:

Make sure the Input box is in a container - that's where you'll set the visibility.

I had my color options (including "other" in a static entity). So I had a setup like this:

Finally, the visibility condition for the container around the input box can be something like this:

I haven't figured how to submit the other desc to it's own table, but I'll ask that in a separate question if necessary.

UserImage.jpg
shubham raghuwanshi

Hey @edoo  not sure if this will help or not Add "Others" option in Dropdown List (Reactive Web App) | OutSystems  also you can add one text box below dropdown that will be visible only once Other option is selected 

2023-02-09 17-26-57
JD136

That one looks to be a way of adding "other" to the list without having it on the static entity. I actually don't mind keeping "Other" on my static entity. More concerned with the last part you mentioned though, how would I make it visible only after Other option is selected? And then how could I write that response to a separate table?

UserImage.jpg
Accelance Partners

@edoo
 
I have attached your updated OML here. as per your requirement, you have to add custom input on selection "Other" as a option. I tried it please take a look

this might help you.

Thanks 
Shriyash

OtherCustomText_v1.oml
2023-02-09 17-26-57
JD136
Solution

Thank you @Shriyash Dixit for your example. There were a few issues with yours (e.g. once the custom text input was showing, then it wouldn't hide again if I picked something else). I did work this out. 

You'll have something like this:

Make sure the Input box is in a container - that's where you'll set the visibility.

I had my color options (including "other" in a static entity). So I had a setup like this:

Finally, the visibility condition for the container around the input box can be something like this:

I haven't figured how to submit the other desc to it's own table, but I'll ask that in a separate question if necessary.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.