Enhance Scaffolding Search - like windows search

Enhance Scaffolding Search - like windows search


I am about to start to learn a programming language to build some personal application, however, since i have found this AWSOMENESS Platform, Outsystems, I am about to giving up learning programming, instead, learning Outsystems.

Coming to the Subject, how could i enchanse the Scaffolding Search like the windows one (as below pix)?



After search, this can be done by:
1. Trim the input
2. explode the input in array
3. create a join query with the arrays parameters

But how can i do this with Outsystems???



Hi Ratana

I believe there's a Text extension that allows you to do string splitting and joining.
If you transform the query text into a SQL condition (field LIKE "%"+firstword+"%"+secondword+"%"+...) you can use an advanced query and pass the text as an expand inline parameter.

Please note that parameters that expand inline are prone to SQL injection attacks, therefore it's recommended to first sanitize your user input (passing each word through the EncodeSQL built-in function).

Dear Miguel, Thank you very much of your help and of course your recommendation of prevention. I do appreciate it. :-) I will continue to figuring out my search follow your comment. And of course, I have to use Advance Sql for this instead of the Aggregate. Regards, Ratana

Hi Miguel,

Well, since i am new to either both Progamming and Outsystems, thing is not going smoothly :-(.
With hours and hours of tryping, it seems i get no where yet.

So far, I have just manage install and upload to my personal environment of Text Extension and make it available to the application. However, once getting start to use it - i am stuck with non documents of it.

Therefore, I am writing for your help to demonstrate if you pardon me.

Here is my environment application ratanainfo.outsystemsclould.com\suppliers (Username: test Password: 1234

I have 7 records in the list

with search input "a" , I would have following 4 records

with search input "om" i would have 6 records

and finally, if my search input "a om" I would expect to have only 3 records
1. Anana Computer
2. AWS Computer
3. Thearun Computer

instead of following

I look forward from you. :-)


Hi Ratana

take a look at: http://www.outsystems.com/academy/11/1682/568/implement-a-search-filter/#VideoTitle

Regards, Harry
Hello Harry, Thanks for your input. I have watched the training already which give me some knowledge of search and filter. Unfortunately, I could not find clue to achieve what I am trying to accomplish. As Miguel post, he is giving the correct path (splitting the input keywords into words, each words pass to query and join all results of query words) for me to do it, but i have just need to know how to apply it with Outsystems. Regards, Ratana
This all boils down to your database query. Figure it out in a SQL tool first and then put it in your Outsystems application.
select from table where column like '%keyword1%' and column like '%keyword2%'
Hello Harry, Since I am using scaffolding features, I have the query with wildcard in the Aggregate of the preparation already. Actually I am searching only into a field or column only {Suppliers}.[Name]. What I do not know to achieve what I am trying to do is as following: 1. splitting input keywords into multiple words with space delimiter (using text extention, string_split) 2. how to take the multiple words into queries 3. how to join all the queries results Regards, Ratana
Hi Ratana,

If I'm following you correctly I think that if you add '%o%am%' in your search you would have the results you wanted. To do this in the filter value in the Aggregate you can use the Replace function to replace spaces ' ' with percentages '%', something like:

{Supplier}.[Name] like "%" + Replace(SearchKeyword," ","%") + "%"

Hello Andre, WOW, this method is much cleaner and I definitely understand it even as a new to programming and to outsystems. just update my Aggregate with your method and it all done. Thank you. Regards. Ratana
Hello Andre,

I have just finsihed update my Aggregate and the result show me what I am expected. Thank you, once again.


Hi Andre and All,

Well after playing around, It seems to me that I have to extend my first small app Search more flexible. Therefore, I have to seperate my input keywords into words (as independent parameter) for query and do the joining like Miquel suggestion. With that, I think I could avoid the 2 pix below results.