Send notification based on a variable response

Russell Park
Mega Guru

Hey guys!  I am working on a workflow and getting close to be completed.  I have a catalog item with about 8 variables.  I need to send a notification based on response to one of the variables.  If variables.type_of_request = CIP then send notification to specific email address.  I added the notification type to workflow but cant figure out how to only send based on the response to that variable.  Any help is appreciated!

 

1 ACCEPTED SOLUTION

Russell Park
Mega Guru
prabhmeet,
 
    You script has helped alot thanks.  I am running into one issue though.  Below is the code.
 
answer = ifScript();
function ifScript() {
if(current.variables.type_of_request == 'CIP' ){
return 'yes';
}
return 'no';
}
 
No matter if its CIP or NON-CIP it is still sending the notification.  It should only send email to the email address IF type of request == CIP.
 
What am i missing?
 
Thanks!

View solution in original post

8 REPLIES 8

Hi Russell,

What type of variables is this type of request? Is it a select box?

Can you please check if the variable name is type_of_request?  Also please check once that CIP  has name CIP with uppercase letters.

I hope you have written the code in an if condition and the yes is connecting to the notification (see below screenshot where my if block yes is connected to an event.)

find_real_file.png

Russell Park
Mega Guru
prabhmeet,
 
      Thank that was my issue, I needed to add the IF condition and add the condition.  Once I did that it works perfect!  Thanks for the help!

Glad to know it works now. Can you please mark my answer as correct/ helpful if it helped.

Russell Park
Mega Guru
prabhmeet I believe i did mark as correct.  Please let me know if i did it wrong.  Im seeing it as "accepted solution"