- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
12-18-2020 08:44 PM - edited 04-30-2023 07:53 PM
I love the tag feature of ServiceNow because you can simply mark any records and thus map search scenarios that would not be possible with normal search filters.
In most cases, it is enough to search for specific tags. But what if you search the other way round, i.e. find all records that do NOT have a certain tag?
With the OOTB possibilities of the filters one does not come here further, however there is a trick.
| We start at the list of all Instance Scan checks with an empty filter and a result list of 621 records. | |
|
The next step is the most important: You have to select two times the Tags criteria and combine them with an OR condition:
|
|
|
The result set is the same as before, and the filter breadcrumbs reflect the configured search.
The next step is to reverse the search query. |
|
|
For that step examine the query part of the URL parameters (sysparm_query). The interesting part here is the double URL-encoded presentation of an equals sign: %253D Right before that expression, insert an exclamation mark which represents the negation of the following expression: ORsys_tags.a81628fc97266110b05bb08fe153afe4!%253Da81628f |
|
After hitting ENTER the search result should only list all records without the excluded tag (now 593 instead of 68 records before).
If you right-click on the filter breadcrumbs and then select "Copy query" you will get the correct representation of the query for the further use in your scripts. |
- 7,860 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello,
thank you for your post, it was helpulf.
But unfortunately, in my case, once there is other assigned tags to the incident records, the result is not the expected. the expected result is to get all the records that doesn't have that tag, but can have others.
Do you have any other option to do this?
I am trying to use it with other filters.
Thank you.
Rita
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Rita,
thanks for your reply and nice to hear that it was helpful. And of course I would be very pleased if you could reward this with a click on "Helpful" 🙂
And to answer your question:
I'm afraid this is not possible with standard means, but with a script approach it should.
Kind regards
Maik
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Maik Skoddow looks like this is now possible using the report builder. I could not figure out the difference between "excluding" and "does not have" but it is also working if you have another tag set.
See also https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0955840
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for the information. Was not aware of this. But at the end I need this capability in the list view and not in den report builder. 😞
Maik
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @Maik Skoddow ,
There are no three dots to apply quick filter on tags in compliance workspace. Any inputs reg the same would be much appreciated.
Kind Regards.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Give this a try. Instead of placing the exclamation point in front of the coded "=", try replacing it totally with "EXCLUDING". So step 4 above would now be:
For that step examine the query part of the URL parameters (sysparm_query).
The interesting part here is the double URL-encoded presentation of an equals sign: %253D
TOTALLY REPLACE THAT EXPRESSION WITH "EXCLUDING":
ORsys_tags.a81628fc97266110b05bb08fe153afe4EXCLUDINGa81628f
Using this, you no longer need the "tag is blank" OR condition in their either. Seemed to work for me. Not sure if it's exactly what you're looking for tho. Good luck!
