How can I script an email recipient based on the value of a variable

Cupcake
Mega Guru

I have a catalog item that has a variable (select box) that contains a list of names. In addition, I have an email notification baked inside of the workflow. What I am trying to do is send the email notification to person that is selected in that select box. Is this something that can be accomplished?

find_real_file.png

 

find_real_file.png

 

1 ACCEPTED SOLUTION

guruprasad1
Kilo Guru

Hi

 

Can try this

answer = [];

answer.push(current.variable.variable_name);

Regards

Guru

View solution in original post

16 REPLIES 16

anupraheja
Tera Expert

You can try something like this :

Glide your sys_user table > pass "select box user" in addQuery and get the email ID then

email.addAddress("cc", emailID_Variable, name_Variable)

Thanks,
Anup


Shashikant Yada
Tera Guru

try below code:

answer = [];  

var arrAppr = current.variables.u_approver.split(",");

for (var i = 0; i < arrAppr.length: i++) {

 

    answer.push.(arrAppr[i].toString());

 

}

guruprasad1
Kilo Guru

Hi

 

Can try this

answer = [];

answer.push(current.variable.variable_name);

Regards

Guru

This didn't work. Thank you for replying.