Can I create a filter in a list (e.g. cmdb_ci.list) with as operator 'does not ends with'

JoSte
Tera Contributor

Hi, I like to add a filter on my cmdb_ci.list to exclude all CI's ending on 'mw'.  I can use the filter operator 'ends with' but not 'does not ends with'.  Does someone knows how I can exclude all CI's end with 'mw' from my list?  Many thanks in advance! -Jo-

1 ACCEPTED SOLUTION

AndersBGS
Tera Patron
Tera Patron

Hi @JoSte ,

 

Please look at this post from 2017 - this should provide a solution to your request: https://www.servicenow.com/community/developer-forum/does-not-end-with-operator/m-p/1565063

 

If my answer has helped with your question, please mark my answer as accepted as solution and give thumb.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

View solution in original post

4 REPLIES 4

phil bool
Tera Contributor

Hey Jo, 
You could exclude all lines where the line contains 'mw', but, to my knowledge, but not only where it ends with that.   I appreciate that's going to give a number of unintended matches. 
You might want to consider updating the suffix to something more distinctive and unique so it's not likely to get so many unintended matches, like "mw_ignore".  You could use a fix script to update the suffix on your records using a standard javascript method like subscript() or regex(), then make your matching condition more specific.  Alternatively, look for another field that identifies the same information.  If 'MW' is the person who created them, can you find these by filtering by the 'created by' field?

AndersBGS
Tera Patron
Tera Patron

Hi @JoSte ,

 

Please look at this post from 2017 - this should provide a solution to your request: https://www.servicenow.com/community/developer-forum/does-not-end-with-operator/m-p/1565063

 

If my answer has helped with your question, please mark my answer as accepted as solution and give thumb.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

JoSte
Tera Contributor

Hi AndersBGS, many thanks for your reply. This solution works for me.  -Jo-

JoSte
Tera Contributor

Hi Phil, thanks for the update but unfortunately, your proposal is not a suitable solution for me.