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

 

 

3 REPLIES 3

Adam Stout
ServiceNow Employee
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

 

Amit Verma
Kilo Patron
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


Please mark this response as correct and helpful if it assisted you with your question.

Amit Verma
Kilo Patron
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.


Please mark this response as correct and helpful if it assisted you with your question.