How to stop both notifications from triggering

Joshua Comeau
Kilo Sage

I have a generic email approval notifications and their being triggered at the same time in my workflow as I have two approval requests being actioned at the same time:

I need it to not send the other notification if the group is this specific group how to make the code work?

Notification 1:

JoshuaComeau_0-1705414127856.png

 

Notification 2:

JoshuaComeau_1-1705414141648.png

 

9 REPLIES 9

AJ-TechTrek
Giga Sage
Giga Sage

Hi @Joshua Comeau 

 

Please cross check the condition for when trigger the notification, there will a small catch due to that both conditions are met and triggering the notification.

 

Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.

 

Thanks

AJ

Linkedin Profile:- https://www.linkedin.com/in/ajay-kumar-66a91385/

I went with but its now triggering both emails:

notification 1:

var assignmentGroup = approvalRecord.assignment_group.getDisplayValue();
    if (assignmentGroup=='ec711d8d1b0921904d480d01cd4bcb11'){
        answer=true;
    }
 
and 
 
Notification 2:
var assignmentGroup = approvalRecord.assignment_group.getDisplayValue();
    if (assignmentGroup=='ec711d8d1b0921904d480d01cd4bcb11'){
        answer=false;
    }


theirs only one condition the group.

Tai Vu
Kilo Patron
Kilo Patron

Hi @Joshua Comeau 

Let change the line number 3 in your script.

From

 

var group = group.assignment_group;

 

 To

 

var group = item.assignment_group;

 

 

You can also give my sample a try.

Notification 1

current.getValue('source_table') === 'sc_req_item' && current.sysapproval.assignment_group.toString() !== 'ec711d8d1b0921904d480d01cd4bcb11';

 

Notification 2

 

current.getValue('source_table') === 'sc_req_item' && current.sysapproval.assignment_group.toString() === 'ec711d8d1b0921904d480d01cd4bcb11';

 

 

Cheers,

Tai Vu