How to configure Separate Ask for Approval Notification for particular Catalog Item Variables

VIKASM535239375
Kilo Sage

How to configure Separate Ask for Approval Notification for particular Catalog Item Variables

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@VIKASM535239375 

what do you mean by separate notification for particular catalog item?

what's your actual business requirement? share some screenshots.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Mark Manders
Mega Patron

OOB approval notifications are triggered from the approval table. If you need certain catalog items to send different notifications, I would use mail scripts to adjust the text of the notification (get the variables needed). On the other hand, why not just include them in all emails?

It would be very helpful to have more information on your business requirement.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Yes Mark I want Approval Mail Notifications to have  Catalog Item Variables included in it.

 

@VIKASM535239375 

Do you want it for approval of all catalog items or specific ones?

You can use email script and use this logic to print the variables

Note: Enhance this below script to print multi row variable set variables

Creating records or a summary from Multi-Row Variable Set (2) 

check this part of the article and enhance the script I shared

AnkurBawiskar_0-1748426235672.png

 

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

    // Add your code here
    template.print('RITM Variables: <br/>');
    var ritm = new GlideRecord('sc_req_item');
    ritm.get(current.sysapproval);
    var variables = ritm.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);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader