- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2020 09:53 AM
I have a Catalog Item called "Employee Onboarding".
The first step in my workflow is a group approval.
I'd like to send out the approval notification request with the name of the new employee in the subject line.
The variable on the requested item is: "legal_name".
The notifications are being triggered from the "sys_approval" table, but variable is somewhere in the "requested_item" table I think.
Can this be done?
Solved! Go to Solution.
- Labels:
-
Request Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 08:26 AM
Heya Joe,
Yeah this is possible. Again this will need to be done in a mail script as you're hoping through related records to get the information.
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
var RITM = current.document_id.getRefRecord();
var workflowGR = new GlideRecord('wf_context');
workflowGR.addQuery('id', RITM.sys_id);
workflowGR.setLimit(1);
workflowGR.query();
if(workflowGR.next()){
var activityGR = new GlideRecord('wf_executing');
activityGR.addQuery('context',workflowGR.sys_id);
activityGR.query();
if(activityGR.next()){
var activity = activityGR.getDisplayValue('activity');
}
}
email.setSubject(RITM.getValue('number') + " " + activity);
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 09:57 AM
Kieran - you're a Wizard!
This script worked perfectly on my first try!!
I can't wait to see your article when you publish it.
Joe