- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2016 09:08 AM
I need to report on all assets with a serial number containing 1 or more spaces anywhere in the value.
1) can wildcards be used in report and filter conditions? e.g. * " " *
2) how would i represent the space? escape sequence?
3) can REGEX be used in reporting?
Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Problem Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2016 11:01 AM
Hi Hubert
You can create a Script Include which will have a function which returns comma separated sys_ids of the desired records. Then the same function can be used as a filter in your table.
E.g: If we want to create a report on the table sys_user where field phone contains any whitespace, we can write following Script Include:
var TestFilter = Class.create();
TestFilter.prototype = {
initialize: function() {
},
getFilter: function() {
var v = new GlideRecord('sys_user');
v.addQuery('phone', 'CONTAINS', ' ');
v.query();
return v;
},
type: 'TestFilter'
};
And then in the report, we can use following (without quotes):
'Business Phone' 'is one of' 'javascript:new TestFilter().getFilter()'
Please refer to Reference Qualifiers - ServiceNow Wiki for further details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 10:28 AM
Worked for me as well. thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
wonderfully simple. thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2025 03:23 AM
Hi Adam,
what is the likely hood you replying to a 9 year old thread with a solution I need then 4 days later! Craziness but thanks a lot!
cheers,
matt