Skip to main content
1-Visitor
Aug 7, 2020 5:02 AM UTC
Solved

Like filter not working with special characters

Hello,

 

When i'm filtering the things using the like filter which contains special characters, it's not returning any results. I have tried using escape characters still no result.

Did anyone face this issue? How did you overcome this? 

 

var filterPattern = "Thingworx Navigate (TN)";
var params = {
inclusive: true /* BOOLEAN */,
fieldName: "Organization" /* STRING */,
t: Devices /* INFOTABLE */,
pattern: filterPattern + "*" /* STRING */,
};

var result = Resources["InfoTableFunctions"].LikeFilter(params);

 

-thanks,

Abhiram

 

CharlesJiAnswer
Support
Nov 18, 2024 3:02 AM UTC

Hi @abhiramk, in this case, you may try to use a double backslash "\\" to escape the special characters.

var filterPattern = "Thingworx Navigate \\(TN\\)";

 

4 replies

Rocket_Max
17-Peridot
Aug 11, 2020 3:06 AM UTC
abhiramk1-VisitorAuthor
1-Visitor
Aug 11, 2020 11:14 AM UTC

Thanks Max for your response.

As per my understanding LikeFilter is to filter infotable rows based on columnValue matching the pattern(will provide wildcard character to filter) we provided right, my infotable is having string values only which contains special characters. It's working with string which doesn't contain spcl char's but not giving an error or response if it contains special characters.

 

 

Translate
abhiramk1-VisitorAuthor
1-Visitor
Aug 12, 2020 7:20 AM UTC

@CarlesColl converting it to JSON and applying javascript filter and converting back to Infotable. Other than this any workarounds are possible. Can you please provide your inputs?

 

-thanks,

Abhiram

Translate
CharlesJiCommunity ManagerAnswer
Support
Nov 18, 2024 3:02 AM UTC

Hi @abhiramk, in this case, you may try to use a double backslash "\\" to escape the special characters.

var filterPattern = "Thingworx Navigate \\(TN\\)";

 

Translate