- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2025 05:12 AM
Hi
Is there any option to send the last attachment from multiple attachments in the email notification?
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2025 08:53 AM
you can use email script but it will only include link to the latest attachment and not the actual file.
if you want to include file in outbound email then link I shared should work
If you want to include link to the latest attachment added to record then use email script
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
template.print('Latest attachment link <br/>');
var gr = new GlideRecord("sys_attachment");
gr.orderByDesc('sys_created_on');
gr.addQuery("table_sys_id", current.sys_id);
gr.setLimit(1);
gr.query();
if (gr.next()) {
var instance_name = gs.getProperty('glide.servlet.uri');
template.print('Click <a href="' + instance_name + 'sys_attachment' + '.do?sys_id="' + gr.sys_id + '">' + gr.file_name + '</a> to view the Attachment.');
}
})(current, template, email, email_action, event);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2025 08:52 PM
@Ankur Bawiskar
no it's not fetching the latest attachment.
is there any other way
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2025 08:57 PM
what script you are using? email script to show link or business rule to add the actual file
what debugging did you do?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2025 09:02 PM
business rule
i've checked with info msgs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2025 06:02 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader