Notification is not working with advanced condition

Aruna13
Tera Contributor

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!!

 

 

1 ACCEPTED SOLUTION

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....

LinkedIn - Lets Connect

View solution in original post

7 REPLIES 7

share the code ! and screenshots


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Aruna13
Tera Contributor

Hi Sohail,

 

The code is working fine and i mistakenly given one condition as wrong. When I removed that condition it is now triggering the notifications.

 

Thank you so much!!!!

Aruna13
Tera Contributor

Hi,

 

This is still not working, Here is my advanced condition - i8t has to check email addresses in the system property and if it is same, it should not send notification.

var email= gs.getProperty('ar.donot.send.notification').split(',');
var emailfrom = current.u_email_from;
var arrEmail = [];
for(var i=0; i < email.length; i++){
if(emailfrom == i ){
   answer = false;
}else{
   answer = true;
}      
}                                                                                                                                            
 
can anyone please guide me?
Thanks in advance!