30
Views
3
Comments
Filter decimal value using search bar
Application Type
Reactive

Hi,

I have a table that has multiple columns. One of the columns is number that is decimal data type. So even if the number is 4 it gets stored in the database as 4.00. I am using the search bar widget to give the user the option to filter the table by any value. What i am facing is that if the user inserts 4 nothing happens, only if the user inserts 4. then then it filters it correct although the user only see 4 and not 4.00. Seems like it does not filter if i just insert one number. Example if i insert 4 i want all rows that have a 4.

Current filter is DecimalToText(Table.Number) like "%" + SearchKeyword + "%" 

Any help or workaround would be highly appreciated. 


Thank you,


Lourenco Matalonga

Hi @Lourenço Matalonga ,

i can't reproduce, when i test, it just filters correctly, can you share an oml demonstrating the problem ?

some thoughts :

  • there is maybe logic in the OnSearch, not refreshing if length of search field is smaller than 2
  • what do you mean with 'searchbar' i can't find that widget, i used Interaction\Search from Outsystems UI
  • If you want users to search on the full decimal, you'll have to also show the full decimal, not the standard 2 digits that Outsystems chooses, otherwise it's a weird user experience
  • searching a decimal as a string doesn't make sense to me, if it is really representing a numeric size of something, whether or not it contains a 6 is a weird thing for a user to search for

Dorine


Hi @Lourenço Matalonga

It is working for me by adding the filter what you have mentioned above and on search client action i am refreshing the aggregate
Below i have attached an oml please check it once.

Asad

DemoOutsystems.oml

Hi @Lourenço Matalonga,


Can you try with this:

1. DecimalToText(Trunc(Table.Number)) like "%" + SearchKeyword + "%" 

Or

2. DecimalToText(Table.Number) like "%" + DecimalToText(TextToDecimal( SearchKeyword)) + "%"  

or

3. Trunc(Table.Number) = Trunc(SearchKeyword) -- it won't work for exact match, instead fetch all matching rows

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