Is there a way to identify the attachments in Email notification?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2020 07:23 AM
Sys_email table contains the list of emails sent or received in an instance. Do we have any method to find the number of records which have attachments in it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2020 07:32 AM
Hi Sowmiya,
There would be a related list in the mail log named 'Email Attachments' if corresponding mail has any attachment. Alternatively, you can look for sys_email_attachment table [Email Attachments] for additional details.
Thanks,
Jaspal Singh
Hit Helpful or Correct on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2020 07:55 AM
Hi
You can use this
var ga = new GlideAggregate("sys_email_attachment");
ga.setGroup(true);
ga.groupBy("email");
ga.query();
gs.log(ga.getRowCount()); //Number of Emails having attachments
Or You can navigate to table sys_email_attachment and do a group by operation on email. Then you can see the row count.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2020 10:40 PM
Hi Nootan, Jaspal,
Thanks for the reply..
We are on Madrid release and this table, sys_email_Attachment is available from Newyork version.
Another other possible ways?
Thanks,
Sowmiya M
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2020 11:13 PM
Hi Sowmiya,
Try below code
var gr=new GlideRecord('sys_attachment');
gr.addQuery('table_name','sys_email');
gr.query();
gs.addInfoMessage(gr.getRowCount()); // gives number of email records having attachments
Mark helpful if this is useful.
Thanks.