Catalog task variable editor Values should transfer to Email Part
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 05:43 AM
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 05:45 AM
@Community Alums
email notification is on which table and when is the email triggering?
are you sure when the email triggers the variables have value in it?
please share your email script
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 05:48 AM
Hi Ankur,
Please find my Code
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
template.print('Variables: <br/>');
var variables = current.variables.getElements();
for (var i=0;i<variables.length;i++) {
var question = variables[i].getQuestion();
var label = question.getLabel();
var value = question.getDisplayValue();
if(label != '' && label=='please_provide_the_name_of_the_application_created_for_oss_mend'){
template.space(4);
template.print(' ' + label + " = " + value + "<br/>");
}
}
Thanks
Kumar
})(current, template, email, email_action, event);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 10:20 PM
Hi Ankur,
email notification is written on SCTASK table, and it should be trigged based on event.
are you sure when the email triggers the variables have value in it? yes Value is there that value only visible on SCTASK
email script is
/
template.print('Variables: <br/>');
var variables = current.variables.getElements();
for (var i=0;i<variables.length;i++) {
var question = variables[i].getQuestion();
var label = question.getLabel();
var value = question.getDisplayValue();
if(label != '' && label=='please_provide_the_name_of_the_application_created_for_oss_mend'){
//template.space(4);
template.print(' ' + label + " = " + value + "<br/>");
}