Notifcation - how to macth multiple words in description and short description content?

MThomas1
Kilo Guru

Hi ,

we have a notitifcation to trigger when the dewcription/short description contains " lost device" . but it is not working when we enter " device lost" . Is there a way to address this situation OOTB?  Thank you.

2 ACCEPTED SOLUTIONS

PoonkodiS
Giga Sage

Hi @MThomas1 

Right now, your condition is likely set to [Description] [contains] [lost device]. ServiceNow looks for that exact string, in that exact order

change the condition as:

[Short description] [contains] [lost]
And [Short description] [contains] [device]
OR
[Description] [contains] [lost]
And [Description] [contains] [device]

Instead of looking for a  exact phrase, this forces ServiceNow to check if both words exist anywhere in the text—completely ignoring what order they are typed in.

 

for reference:

Using keyword search with wildcards - Support and Troubleshooting - Now Support Portal

 

View solution in original post

SoureshD6782072
Mega Expert

Yes, this is expected behavior and not a bug. The Contains operator in ServiceNow checks for the exact sequence of characters entered in the condition, so if the notification condition is configured as Short description/Description contains “lost device”, it will only match text where the words appear in that same order.

It will not match “device lost” because that is a different phrase order. The simplest OOTB approach is to add additional OR conditions, such as Short description contains lost device OR Short description contains device lost OR Description contains lost device OR Description contains device lost.

If you want a more flexible approach, you can use an Advanced condition on the notification to check whether both keywords exist regardless of order, for example by checking if the combined short description and description contain both “lost” and “device”.

In short, ServiceNow’s standard condition builder performs literal text matching and does not provide semantic or word-order-independent matching OOTB, so either add multiple OR conditions or use an advanced scripted condition for better flexibility.

View solution in original post

3 REPLIES 3

PoonkodiS
Giga Sage

Hi @MThomas1 

Right now, your condition is likely set to [Description] [contains] [lost device]. ServiceNow looks for that exact string, in that exact order

change the condition as:

[Short description] [contains] [lost]
And [Short description] [contains] [device]
OR
[Description] [contains] [lost]
And [Description] [contains] [device]

Instead of looking for a  exact phrase, this forces ServiceNow to check if both words exist anywhere in the text—completely ignoring what order they are typed in.

 

for reference:

Using keyword search with wildcards - Support and Troubleshooting - Now Support Portal

 

MThomas1
Kilo Guru

Thank you for your guidance.

SoureshD6782072
Mega Expert

Yes, this is expected behavior and not a bug. The Contains operator in ServiceNow checks for the exact sequence of characters entered in the condition, so if the notification condition is configured as Short description/Description contains “lost device”, it will only match text where the words appear in that same order.

It will not match “device lost” because that is a different phrase order. The simplest OOTB approach is to add additional OR conditions, such as Short description contains lost device OR Short description contains device lost OR Description contains lost device OR Description contains device lost.

If you want a more flexible approach, you can use an Advanced condition on the notification to check whether both keywords exist regardless of order, for example by checking if the combined short description and description contain both “lost” and “device”.

In short, ServiceNow’s standard condition builder performs literal text matching and does not provide semantic or word-order-independent matching OOTB, so either add multiple OR conditions or use an advanced scripted condition for better flexibility.