How to include leading/trailing space in search string? i.e. Find ' RFO ' not 'performance'

Michael Gruber
Tera Contributor

Team,

 

What magic will allow me to add either leading or trailing spaces to my report filter?

 

For example, I want to find the string 'rfo' in a field, but not pick up 'peRFOrmance'.

 

the string could either be '+rfo' or 'rfo+', but unlikely to have both a leading and trailing character.

 

I did try using the escape character for space, but that did not work, i.e.

 

rfo\u0020

\u0020rfo

 

regards

Michael

 

 

4 REPLIES 4

Adam Stout
ServiceNow Employee

Try

description CONTAINS javascript:' rfo'; 

or 

descriptionCONTAINS javascript:'rfo '; 

 

Here is an example with the normal contains.  This picks up "issue" in addition to "is"

2025-02-27_14-02-41.png

 

And then with the javascript which lets me have leading and/or trailing spaces.  This is "is" only.

2025-02-27_14-02-26.png

 

vermaamit16
Kilo Patron

Hi @Michael Gruber 

 

Could you please try with the filter conditions as shown below:

AmitVerma_0-1740719821134.png

 

short_descriptionLIKEjavascript:'rfo ';^ORshort_descriptionLIKEjavascript:' rfo';

 

 

Thanks and Regards

Amit Verma

vermaamit16
Kilo Patron

@Michael Gruber 

 

I hope my solution was able to assist you. Could you please mark my answer as correct for others to follow.

JaxonA
Tera Contributor

This recommendation is helpful when filtering a view or table, but doesn't appear to work when used within the Edit Data Source pane of Platform Analytics.