Email Notification: "Does Not Change" condition in "When To Send"

AdamSaniS
Tera Contributor

Hi Experts,

 

I need advice and cannot find the similar discussion here in community.

We want to send email whenever there is an update in the record (Record updated) but disregarding changes in this 1 particular Field. (Meaning, if the change involves this particular Field, no need to send notification).

 

Therefore - the question is, how do set a condition where (Field): (does not change) in the notification? There is no available choice from the condition operator dropdown choices.

 

AdamSaniS_1-1744170724509.png

 

Thanks!

 

2 REPLIES 2

Community Alums
Not applicable

Hi @AdamSaniS ,

o achieve this in ServiceNow, you can use a Business Rule to control when an email notification should be sent, based on changes to a particular field. Since the condition operator dropdown doesn't directly offer an option for "Field does not change," you can work around it by checking if the field's value has changed or not using a Business Rule and scripting.

 

  • Go to System Definition > Business Rules.

  • Create a new Business Rule for the table where the record resides e.g., Incident..

Business Rule Script: In the Business Rule script, you will need to compare the current value of the field with the previous value of the field to see if it has changed. If the value has not changed, you can prevent the notification from being sent.

 

******In the Business Rule, you can trigger the notification by using gs.eventQueue(), or you can set conditions directly in the notification itself based on other field changes.

 

Optional – Use Event Rules: If you prefer, you can set up an event-based notification system. You can trigger an event from the Business Rule (when the field doesn't change) and then have the notification sent based on the event.

 

Abhayraj
Tera Contributor

You can try by adding script to your 'When to send" condition. 

  • Send When : record updated
  • Condition: Advanced Condition
  • Use this script

            if (current.your_field.changes() && !current.changes()) {
                  answer = false;
             } else {
             answer = true;
}