Combined search functionality

Hello Experts,

I am new to the outsystems platform and trying to build a sample application.

In this application I have an entity with Name (text), LastName(text) and Gender(Static Entity) Attributes.

I am using Input Variable to search Name and last Name using LIKE and Gender is selected through Dropdown list. I am refreshing my Aggregate using these filters. 

Now, when user enters Search text and selects Gender, it works fine.

But when user removes the Search text and selects only Gender, it still gets all the data from entity. My objective is to get only the selected Gender data.

I tried OR/AND filters but still not able to get the selected gender data. 

Please help!!

Regards,

Amit


Hello Amit,


You can try this filter structure.


I hope this will solve your issue.


Regards, 

Riyaz

Hello Amit,

As per Riyaz solution you can use same filters but I have a small update to first filter to check  first if search text is empty or not because if search text is empty and table contains high number of records filter will be something like Person.Name like "%%" which will scan whole table to return all records in the table which may causing performance issue.


I recommend to use first filter as following to check search text is empty or not

@Muhammed Riyas -- Thanks for you help, the filter criteria mentioned by you works fine as per my requirement.

@Mostafa Othman -- Thanks for you suggestion, I will definitely keep it in mind while working with a large amount of data. 



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