Show checkbox value instead of true/false

gnunez
Kilo Guru

Hello all,

I am trying to find a way to display the checkbox value instead of "true" "false" on the email notification "Request Opened on behalf". We would like for the requester to receive a list of the software requested in the email, but the way the values are showing now are just true, false. 

I looked through other threads and some say email script but I have no idea where to get started on this because I don't know much about scripting, but can anyone assist with this? Or point me to the right direction?

E.g. Software list: microsoft office, adobe creative cloud, dreamweaver, etc. 

If user selects office but not the other ones then the email notification look something like this:

Number: RITM4242

Requested for: Jane Doe

Software requested: Microsoft Office

My email script below:

 

 

 

Thanks in advance,

Grace

1 ACCEPTED SOLUTION

gnunez
Kilo Guru

This was my solution:

1. Create a notification email script (e.g. checkbox) and list out your checkbox values accordingly:

(function runMailScript(current,template,email,email_action,event) {

if(current.variables.checkbox_value=='true'){
template.print("Checkbox Name," + ' ' );
}
if(current.variables.checkbox_value2=='true'){
template.print("Checkbox Name2," + ' ');
}

..........

template.print('</p>');

})(current, template, email, email_action, event);

 

2. Create an email notification and add the email script to an email template
e.g.  Add the following in message HTML = ${mail_script:NAMEHERE}

View solution in original post

6 REPLIES 6

gnunez
Kilo Guru

This was my solution:

1. Create a notification email script (e.g. checkbox) and list out your checkbox values accordingly:

(function runMailScript(current,template,email,email_action,event) {

if(current.variables.checkbox_value=='true'){
template.print("Checkbox Name," + ' ' );
}
if(current.variables.checkbox_value2=='true'){
template.print("Checkbox Name2," + ' ');
}

..........

template.print('</p>');

})(current, template, email, email_action, event);

 

2. Create an email notification and add the email script to an email template
e.g.  Add the following in message HTML = ${mail_script:NAMEHERE}

Cindy26
Tera Expert

I am trying to use this mail script but it is not printing anything in the notification. Here is the script I've written.

The checkbox variables are "dynamics_crm", "waterquote" and "repe_number". 

What am I doing wrong? 

 

(function runMailScript(current,template,email,email_action,event) {

if(current.variables.dynamics_crm=='true'){
template.print("Dynamics CRM," + ' ' );
}
if(current.variables.waterquote=='true'){
template.print("WaterQuote," + ' ');
}
if(current.variables.repe_number=='true'){
template.print("REPE number," + ' ');
}


template.print('</p>');

})(current, template, email, email_action, event);