
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 01:45 PM
I have a notification with the following line.
Evidence Collection Instructions: ${mail_script:evidence_evidence_collection_instructions}
Looking at the mail script, I have the following. Line 7 & 8 should point to the following field on the screenshot below.
As you can see, the evident_details field is an html field. I need help to see why it is not carrying the data over to the notification.
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
var evidence = new GlideRecord('sn_grc_advanced_evidence_collection_details');
evidence.getValue(current.evidence_details);
template.print(evidence.evidence_details.getDisplayValue);
})(current, template, email, email_action, event);
SCREENSHOT:
EMAIL Preview: Missing data.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 02:14 PM
Thanks. Looking at screenshot I assume evidence_reqeust is common field between 2 tables with same values
Try below
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
var evidenceis = new GlideRecord('sn_grc_advanced_evidence_collection_details');
evidenceis.addQuery('evidence_request',current.sys_id);
//evidence_reqeust I assume is common field between 2 tables
evidenceis.query();
if(evidenceis.next())
{
template.print(evidenceis.evidence_details);
}
})(current, template, email, email_action, event);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 01:49 PM
Tyoo
template.print(evidence.evidence_details.getDisplayValue);
should be
template.print(evidence.evidence_details.getDisplayValue());

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 01:50 PM
Or simply keep
template.print(evidence.evidence_details);
as its non-reference type field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 02:01 PM
template.print(evidence.evidence_details.getDisplayValue());
- No Change (shows nothing).
template.print(evidence.evidence_details);
-Shows undefined.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 02:05 PM
Can you try below
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
// Add your code here
var evidenceis = new GlideRecord('sn_grc_advanced_evidence_collection_details');
evidenceis.addQuery('sys_id',current.sys_id);
evidenceis.query();
if(evidenceis.next())
{
template.print(evidenceis.evidence_details);
}
})(current, template, email, email_action, event);
What table notification is on? If it is on same table as GlideRecord in script as above you can simply use
${evidence_details} in the notificaiton body instead of using mail script