Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Language translation for email notifications with email scripts to show all variables

Kaustubh k
Tera Expert

Hello All,

 

Thanks for looking into my query, we have a requirement to translate notifications , for which we are using dynamic translation, but the email body with the email notification script is not getting translated .

 

please help how we can embed the below email script to have the translation and generate translation's;

template.print("<ul>");
    var hideVars = ['###'];
    var ritmVars = new GlideRecord('sc_item_option_mtom');
        ritmVars.addQuery('request_item', current.sys_id);
        ritmVars.query();
    while (ritmVars.next()) {
        if (ritmVars.sc_item_option.item_option_new.u_hide_email == true)
            hideVars += '###' + ritmVars.sc_item_option.item_option_new.name;
    }
    hideVars += '###';
    var set = new GlideappVariablePoolQuestionSet();      
        set.setRequestID(current.sys_id);
        set.load();
    var vs = set.getFlatQuestions();
    for (var i=0; i < vs.size(); i++) {
        if (vs.get(i).getLabel() != '' && vs.get(i).getDisplayValue() != '' && hideVars.indexOf(('###' + vs.get(i).getName() + '###')) < 0) {
            template.print("<li>");
            template.print(vs.get(i).getLabel() + ": " + vs.get(i).getDisplayValue());
            template.print("</li>");
        }
    }

   
    template.print("</ul>");
 
 
 

 

0 REPLIES 0