22-02-24 03:29 PM
Hi,
I am trying to filter my collection with a pattern like this. description Like %temp%access%
It seems to not work in Blue Prism. How should i do this?
22-02-24 03:47 PM
What is the specific error message you're getting when you attempt this?
Are you using the 'Filter Collection' action within the "Utility – Collection Manipulation" Object?
Can you share an example of how you're trying to do this so others can provide recommendations?
22-02-24 04:00 PM
Sure. Here is the error message
Internal : Could not execute code stage because exception thrown by code stage: Error in Like operator: the string pattern '%temp%access%' is invalid.
This is the action
22-02-24 04:05 PM
Hello KT
Could you try;
"[description] like '%temp%' AND [description] like '%access%'"
description column must be in brackets
Regards
------------------------------
Daniel Sanhueza
RPA Professional Developer
Deloitte
America/Santiago
------------------------------
26-02-24 04:54 AM
28-02-24 09:30 AM
Hi KT,
The LIKE operator allows a wildcard (% or *) at the beginning of the string, at the end, or both. For some reason, it doesn't allow a wildcard in the middle.
The workaround is what Daniel has already posted: break it into multiple LIKE operations. Technically, this doesn't give exactly the same results: No access to temp
matches the conditions [description] like '%temp%' and [description] like '%access%'
even though it isn't like '%temp%access%'
. If this is an important difference in your case, you may have to loop through the results and do a second check (using Regex or InStr).
Hope this helps.
28-02-24 07:06 PM
Hello KT. A far as my experience goes, if there are more than one conditions, the expression needs to enclosed in parenthesis and also the "like" should be in upper case. So essentially it should look like
([description] LIKE '%temp%') AND ([description] LIKE '%access%'))
The order of and or conditions can be achieved by parenthesis. Could you try the above?