Hi Guys
I'm implementing a solution using Like in an expression, but I have the following situation: within my search I can have a value = "Turbo" or "Turbo Tank" and for my condition I want the like to make the difference between these two
Expression:
ContainerCollectionLocation.Location like % + Location_Input + %
As I understand, If you have to filter only match result why don't you use = inside the filter as shown below.RegardsKrishnanand Pathak
Hi Fabiano Silva,
Use below condition like this to make difference,
Location_Input like % + ContainerCollectionLocation.Location + %
Let me know if you need more information.
Regards,
Shubham
In that case it can't find any searchSorry for not sharing the OML, because it's from the company I work for
Can I know where you are using that condition, in Aggregate for filter?
I'm using it in a filter inside an aggregate
Hi @Fabiano Silva, like is only available in aggregates and SQL, so if you are trying to achieve this in an aggregate filter or SQL, you are going in the right direction. In case you want it in a normal expression, try the index function (refer to the image below).Index(ContainerCollectionLocation.Location, Location_Input) <> -1
ThanksGitansh Anand
I have a list where I can have valuesTestTest2TestEmailcomboTankhowever, when I put the Test value in the filter input, I want to search only Test, I don't want my search to return Test2, TestEmail
Hi @Fabiano Silva
Possibly we can say this is the limitation for Outsystems aggregate because the logic you mentioned can achieve by IN Operator, so according to your business requirement you can use SQL widget and write a select query.
For example -
SELECT * FROM {ContainerCollectionLocation} WHERE {ContainerCollectionLocation} .[Location] IN ("Turbo" ,"Turbo Tank" , "value N")
I hope it'll help you to solve your problem.
Thanks
Deep
Hello Fabiano Silva
To make a distinction between the two values "Turbo" and "Turbo Tank" when using the Like operator in OutSystems, you can modify the expression to include a space character after the search term when searching for "Turbo", like this:
(ContainerCollectionLocation.Location like '%' + Location_Input + '%' and ContainerCollectionLocation.Location not like '%' + Location_Input + ' Tank%') or (ContainerCollectionLocation.Location like '%' + Location_Input + ' Tank%')