How to populate the all variables of submitted catalog item in the notifications

divyal09
Tera Contributor

How can I populate all variables in the notification from the submitted catalog item. I tried updating it with email script but the variables are not getting populated.

14 REPLIES 14

Try this 

ritm.get('request', current.sys_id);

I tried adding these lines also, but variables are not getting populated in the email triggered

Maybe the problem is not in your email script rather than how you call it from the workflow?

I have added the email script in the notification itself and the notification is getting triggered based in the event. 

@divyal09 

Try this script:

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

    template.print('Variable Summary: <br/>');
 
    varvariables = 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 != ''){
            template.space(4);
            template.print('  ' + label + " = " + value + "<br/>");
        }
    }

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