- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2022 09:47 PM
Glad to know.
For that sysId you need to query the table being referred by that variable and then get the display value
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var record = new GlideRecord('sc_req_item');
var sysCurrentRecordSysId = current.sysapproval;
record.addQuery('sys_id', sysCurrentRecordSysId);
record.query();
if (record.next()) {
var obj = JSON.parse(record.variables.request_information); //update with your variable set name
for(var i=0; i<obj.length; i++) {
var rec = new GlideRecord('tableReferredBySystemName');
rec.get(obj[i].system_name);
var rec1 = new GlideRecord('tableReferredByProfileName');
rec1.get(obj[i].profile_name);
template.print('<br/>' + 'System: ' + rec.getDisplayValue());
template.print('<br/>' + 'Profile: ' + rec1.getDisplayValue());
template.print('<br/>' + 'Approver: ' + obj[i].aprovador_do_perfil);
}
}
}
)(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
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2022 04:18 AM
Thanks Ankur, now its working perfectly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 05:33 AM
Hello Ankur,
Hope your doing well.
I am trying to print both variable and multiple row variable set data on the approver email notification.
can you help me with this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 06:58 AM
Could you raise a new thread for this and tag me there?
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 08:11 AM