38
Views
10
Comments
Solved
[OutSystems UI] Add new value to DropdownSearch list when not found
Question
outsystems-ui
Reactive icon
Forge asset by OutSystems
Application Type
Mobile

I need to create new functionality for DropdownSearch or use a different component.

I have an entity that looks like this:

I need to create something like DropdownSearch that works as follows:

When the user searches for a record and the record does not exist, and the user clicks Enter, it should add a new record to the database with the typed name.

Is there any possibility to achieve this?

I can use different component, that looks different, but already have this functionality.



2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hello @Łukasz Kaproń 

Dropdown Search/Tags already allow you to have that functionality:

For that, you need to use the extensibility client action

SetVirtualSelectConfigs,that should be called in the Initialized event handler from the Dropdown Search/Tags, and where the property allowNewOption should be set to True, like this:

Then, in the InChanged event handler, we need to use JSONSerialize

This way, we can get the values in JSON and work with them for new options:


Hope it helps!

Cheers,
GM


2023-10-16 05-50-48
Shingo Lam

In ODC, you can use DropddownServerSide to handle this. Please refer to this sample https://personal-zfpr4idz-dev.outsystems.app/DropdownServerSideDemo/

Hope this help

Dropdown Server Side Demo.oml
2025-02-10 17-24-13
Arun Rajput

Hi @Lukasz Kapron 

I don't think using outsystems default dropdown search component you can achieve this. you need to create custom drop down for this.

Thanks

2022-12-22 10-00-39
Beatriz Sabino

Hi Lukasz,

There this component in forge that might help you. This uses the widget DropdownServerSide, if you don't want to use that widget you can at least see how to implement that logic into your custom DropdownSearch widget.

2024-12-10 04-40-04
Gitansh Anand

Hi @Lukasz Kapron, I would suggest you to use DropdownServerSide, it has customization possibility, in the "BalloonContent" placeholder, in the if condition when the list is empty instead of showing "No options to show..." text, you can add button to add the typed value. This will be faster then building a custom dropdown.

Thanks
Gitansh Anand

UserImage.jpg
Łukasz Kaproń

Where can I find it in ODC?

2024-12-10 04-40-04
Gitansh Anand

Hi @Lukasz Kapron, check in OutSystemsUI, if its not there then maybe it is not available in ODC yet.

2023-03-13 10-26-05
Sriyamini

Hi,

 you can implement this simple pattern like track the user input using the OnChange event of the DropdownSearch or a separate Input field.

If the entered value is not found in your existing list, show a conditional UI block a button or message like Add X as new item?

On click of that button, trigger an action to create the new value in your entity update the source list and set the newly created value as the selected one.

Refresh the DropdownSearch options.

Thanks,

Sriyamini J

UserImage.jpg
Łukasz Kaproń

How can I track user input? I don't see any event for this

2025-07-22 10-30-27
Mandar Deshpande

Hi @Lukasz Kapron, 

You can achieve this using the "Dropdown + Input" hybrid approach which would be a in customized way. Since you want the user to type and then press enter to save if the record isn't found, you can use a combination of a Search Input and a List.

You can follow below approach:

  • For Search Input: Use a standard Input widget with a variable (e.g., SearchText).
  • For the List: Below the input, show a filtered list of professions based on SearchText.
  • The "Add New" Logic: Use the On Change or On Render event of the input.
  • If the list length is 0 (no record found), show a "Press Enter to add a [SearchText] message or button.
  • On the Input's KeyDown event (check for "Enter"), you can call a client action that checks if the record exists. If not, call a server action to CreateProffesion and then refresh your data.

Hope this helps.

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hello @Łukasz Kaproń 

Dropdown Search/Tags already allow you to have that functionality:

For that, you need to use the extensibility client action

SetVirtualSelectConfigs,that should be called in the Initialized event handler from the Dropdown Search/Tags, and where the property allowNewOption should be set to True, like this:

Then, in the InChanged event handler, we need to use JSONSerialize

This way, we can get the values in JSON and work with them for new options:


Hope it helps!

Cheers,
GM


2023-10-16 05-50-48
Shingo Lam

In ODC, you can use DropddownServerSide to handle this. Please refer to this sample https://personal-zfpr4idz-dev.outsystems.app/DropdownServerSideDemo/

Hope this help

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