Can you use previous on a notification?

matthew_hughes
Kilo Sage

On a notification, I only want it to trigger if the following conditions are met:

if (previous.getValue('u_cmdb_data_steward.manager') == current.getValue('u_cmdb_data_steward')) {
    answer = true;
}
 
The above query checks if the previous manager of the steward is the current steward. Can you use previous in a notification?
22 REPLIES 22

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @matthew_hughes ,

 

You can not use the previous in notification. You can achieve this by using businees rule.

You can use and check the condition in BR previous can be used in BR.

Trigger the notification using event from BR.

 

Thank you,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Hi @Omkar Kumbhar 

 

Do you have an example of how a business rule and notification are connected?

Please find the below article

https://www.servicenow.com/community/developer-articles/setup-email-notification-using-business-rule...

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Using previous won't be possible is a notification. Perhaps if the notification is triggered through an event, created from a Business Rule for example you could. Though within a Notification record itself, no, not possible.

 

Can you describe your situation? When/how the notification is triggered?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn