- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 11:42 PM
Hi,
I have a business requirement to create some notifications for a custom table we have, and the notification should not send to particular email addresses. I have stored those restricted email addresses under a system property. Now, I need to have the advanced condition to check the list of emails stored in system property and do not send notification to the same, if the email is not listed in the system property, then it should send the notification.
Note: The customer do not want me include those email address in condition as it can be removed mistakenly, so they asked me to have a system property and use an advanced condition.
Can anyone please help with the advanced condition?
Thanks in Advance!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 12:40 AM
Hi @Aruna13 ,
Try this way :
var email= gs.getProperty('ar.donot.send.notification').toString().split(',');
var from = current.email_from.getDisplayValue();
var arrEmail = [];
for(var i=0; i < email.length; i++){
if(from == i ){
add the found email to arrEmail and send email to the array list...
}
}
(do your action...)
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2024 11:51 PM
Hello @Aruna13
Please find the below link.
https://www.servicenow.com/community/developer-articles/make-a-better-notification-with-system-prope...
Thanks
SP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 12:00 AM
I need to have advanced condition and the link you provided doesn't seem helpful for my query.
I already wrote this script, but it is not working. Don't know what is wrong here, Need help since i am creating this custom notifications for the first time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 12:40 AM
Hi @Aruna13 ,
Try this way :
var email= gs.getProperty('ar.donot.send.notification').toString().split(',');
var from = current.email_from.getDisplayValue();
var arrEmail = [];
for(var i=0; i < email.length; i++){
if(from == i ){
add the found email to arrEmail and send email to the array list...
}
}
(do your action...)
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 12:51 AM
I tired and it is also not triggering any notification!! 😞