How is your experience with the OutSystems Community?
18
Views
3
Comments
Solved
we don’t want dropdown search to trim spaces

We are currently using the Dropdown Search widget, and we are facing an issue where we do not want the search input to trim spaces.

For example, if we have a value like “Dog”, and the user searches with “Do ” with one trailing space, we want the Dropdown Search to return no results. However, currently it seems that the widget ignores the space and trims it out before searching.

As shown in the image, we would like to know how we can solve this issue, or whether there is a way to prevent the Dropdown Search from trimming spaces in the search keyword.


dropdown Search with Space.png
2026-06-20 17-43-43
Sherif El-Habibi
Champion
Solution

Hello @sahatsawat kthasattapich,

I believe this is how the Dropdown Search from OutSystemsUI works. You may want to consider creating your own customized dropdown with the same search behavior and design. You can even reuse or copy the OutSystemsUI implementation and modify it based on your requirements.

The dropdown search itself would execute a query similar to this:

WHERE

    @SearchValue = LTRIM(RTRIM(@SearchValue))

    AND YourColumn LIKE '%' + @SearchValue + '%'

What happens here is the following:

If the user types something like ' Do  ' and you have a record such as 'Dog' in the database, the first condition checks whether the search input contains any leading or trailing spaces.

In this case:

  • ' Do  ' is compared against 'Do' after trimming.
  • Since they are not equal, the condition fails.
  • As a result, the query returns no results and the search is ignored.

On the other hand, if the input does not contain leading or trailing spaces, the first condition passes, and the second condition is then responsible for performing the actual search using the LIKE statement.

UserImage.jpg
sahatsawat kthasattapich

Thank you so much. I have now changed it to a server-side dropdown with a custom search text implementation.
I think it may not be possible to fully change the behavior of the default Dropdown Search widget.

2026-06-20 17-43-43
Sherif El-Habibi
Champion

You're very welcome.

It can be done, but it would require significantly more effort. The easier approach would be to create your own implementation and add it as a new pattern inside _Pat module.

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