How to get Notification name from sys_email table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 08:34 AM
Can anyone please suggest how to fetch notification name from sys_email table for a before insert business rule.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 08:47 AM
@Ap_1 Here is the script you should use inside your business rule.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var glideSysEmailLog = new GlideRecord('sys_email_log');
glideSysEmailLog.addQuery('email', current.email);
glideSysEmailLog.query();
if (glideSysEmailLog.next()) {
var notification_name = glideSysEmailLog.getDisplayValue('notification');
gs.info(notification_name);
}
})(current, previous);
Please mark the answer helpful and correct if it answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2023 05:30 AM
Hi Sandeep,
This is not working.
I have written a before BR, on sys_email table and if I GlideRecord on sys_email_log table for fetching the notification as below,
var glideSysEmailLog = new GlideRecord('sys_email_log'); glideSysEmailLog.addQuery('email', current.email);
it is showing no records, as may be at that time the log is not yet created on email logs, so not getting any record.
Thanks,
Aparajita

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2023 08:52 AM
Hi Aparajita,
You can find it in sys_email_log table.