Can you use previous on a notification?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 12:54 AM
On a notification, I only want it to trigger if the following conditions are met:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 05:25 AM
As suggested by other using Event Queue + BR approach is the best for this use-case.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 08:02 AM
@Ankur Bawiskar I've tried the following, but it returns my current Sys ID:
How do I get the name of the previous user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 08:16 AM
you should use this to get display value
previous.<fieldName>.getDisplayValue()
So 1 change is as below and you can make necessary changes at other places
previous.u_business_owner.getDisplayValue()
similarly apply it for other reference fields
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 12:20 AM
Hi @Ankur Bawiskar I've made the below changes to my code:
However, what I've found is that even if I make change to those 3 fields, it doesn't generate an event. Do you know why that could be?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 12:37 AM
3rd parameter should be recipient for eventQueue() method
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader