55
Views
8
Comments
Solved
Search Keyword and Filtering problem

I encountered two issues about the searching in the list. (Mainflow/JobMaintenance2s)

1. I wanna search Target Year and Year in the searchbox, 

-->I added a calculated attribute (Year) for the list  and Set the filter as below but still can't search the Year value in the search box. Please help look into the case and advise.



2. My dropdown filter can only list out the current page instead of all pages.
-->Please suggest how to display the listed record of all pages instead of the current page .

Test_20230915.oml
Solution

Hey Winnie,

1. I suggest removing the "%" from the year filter, as the calculated attribute result is an integer they are not needed. But you should also add validations because you're using one search input for everything the year search should only be run when the input is an integer, otherwise, you won't get any results. 

If you cannot separate filters I suggest you use the following for searching for year in the filters: If(TextToIntegerValidate(SearchKeyword), Year = SearchKeyword, True)

For nr 2 the reason the list is only filtering on the displayed records is because you are using the ListFilter action on the current records list. 

What you should do is use the dropdown variable to query the entire aggregate. But remember, when you filter with the dropdown you need to reset the pagination. 

I couldn't test it on your solution but I believe that should solve your issues. 

Regards,

Gonçalo

Champion
Solution

Hello @Winnie Lam 

Add the conversion if you are applying filter on integer column

you can use integertotext() function

I have made changes to your OML and updated it you can see it for reference

I hope this will help

Thanks
Tousif Khan

Test_20230915.oml
Solution

Hey Winnie,

1. I suggest removing the "%" from the year filter, as the calculated attribute result is an integer they are not needed. But you should also add validations because you're using one search input for everything the year search should only be run when the input is an integer, otherwise, you won't get any results. 

If you cannot separate filters I suggest you use the following for searching for year in the filters: If(TextToIntegerValidate(SearchKeyword), Year = SearchKeyword, True)

For nr 2 the reason the list is only filtering on the displayed records is because you are using the ListFilter action on the current records list. 

What you should do is use the dropdown variable to query the entire aggregate. But remember, when you filter with the dropdown you need to reset the pagination. 

I couldn't test it on your solution but I believe that should solve your issues. 

Regards,

Gonçalo

Hi :)

I notice that for the years you are using the following:

You have to choose if you want to use 'like' with '%' or =, you can't use both because they have different meanings; you should remove the '%' and keep just 'Year = SearchKeyword' or 'Year like "%" + SearchKeyword + "%" ';

You also have to notice that they have different data types, so you might need to work with that as well


For the second one, you don't need to use the list filter, you can just filter your aggregate and, on the dropdown on change, refresh and reset the start index.

I'm sorry, I can't provide an oml or test in yours because I'm missing dependencies, thus having a lot of errors

Hey @Winnie Lam ,

You should use 

Year like "%" +SearchKeyword+"%"


if still not works then use

Year = SearchKeyword 


Thanks & Regards,

Sudip Pal

Hi @Winnie Lam,

I suggest you should try using the "like" operator instead of "=".

so your filter should be something like this,

year like "%" + SearchKeyword + "%".

Hope this helps, Thanks!

For nr 2 the reason the list is only filtering on the displayed records is because you are using the ListFilter action on the current records list. 

Champion
Solution

Hello @Winnie Lam 

Add the conversion if you are applying filter on integer column

you can use integertotext() function

I have made changes to your OML and updated it you can see it for reference

I hope this will help

Thanks
Tousif Khan

Test_20230915.oml

Hi @Winnie Lam
In your case you have to either use % or = . If you would like to use like then you need to use % elsde the next one.

Year like "%" +SearchKeyword+"%  
or
Year = SearchKeyword 

Regards,
Shalaka

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