Filter Collection - Name Like *[Data]* issue

lindsey_pecor

New Member
I have been successfully filtering a collection using a data item as a wildcard, but I recently ran into an issue where the name in the data item included a ' and it's caused an error.

Example: Data Item Name = L'Oreal

Action: Filter Collection
Filter: "Name LIKE '" & "*" & [Data Name] & "*"& "'"

Error message: Internal : Could not execute code stage because exception thrown by code stage: Syntax error: Missing operand after 'Oreal' operator.

Does anyone know a workaround for this when a data item contains a ' value?

Thanks!
 

gil.silva

Active Member
Hello Lindsey,

The single quotation mark is a special character, therefore you need to escape it.
You can insert a calculation stage before the filtering, to replace the single quotation mark for two single quotation marks.

Then, you won't face problems to filtering and it works the same way, since you're using the operator LIKE.
View attachment 1564645578116.png
 
Top