Inbound Email - Has attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 10:20 AM
Hi Community,
Is there a way to check if an inbound email has attachment? I am using this script to check attachment:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 10:22 AM
Hi @athavichith
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2025 10:45 AM
Hi @athavichith
var email_log = new GlideRecord('sys_email');
email_log.addQuery('uid', email.uid);
email_log.query();
if (email_log.hasNext()) {
email_log.next();
var hasAttachments = email_log.has_attachments; // Check if the email has attachments
if (hasAttachments) {
// Handle the case where the email has attachments
// For example, you might want to attach the attachments to a related record.
} else {
// Handle the case where the email does not have attachments.
}
}
Kindly mark my answer as helpful and accept solution if it helped you in anyway.