Inbound email
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 09:33 AM
how can we add a attachment in inbound email action.
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 09:40 AM
Hi @User_267,
Please refer to this post:
If you found my solution correct or helpful in any way, please don't forget to mark it to help future readers! 👍
--
Kind regards,
Marcos Kassak
Solution Consultant 🎯
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 09:46 AM
Hello @User_267 ,
Please find the below code in the inbound email action.
var sysAttach = new GlideSysAttachment(); var emailSysId = sys_email.getUniqueValue(); gs.log("Email sys_id is: " + emailSysId, "TITUS"); if (emailSysId) { var sysEmailAttachments = sysAttach.getAttachments("sys_email", emailSysId); gs.log("Number of attachments found: " + sysEmailAttachments.getRowCount(), "TITUS"); gs.log("Updating attachments to table: " + current.getTableName() + " and sys_id: " + current.getUniqueValue(), "TITUS"); while (sysEmailAttachments.next()) { sysEmailAttachments.setValue("table_name", current.getTableName()); sysEmailAttachments.setValue("table_sys_id", current.getUniqueValue()); sysEmailAttachments.update(); } }
If I was able to help you with your case, please click the Thumb Icon and mark as Correct.