We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

if any attachments submitted with the HR case, include those attachments in the email.

snehalkausa
Tera Contributor

Hi

I am working on a flow(hr core scope) where I am using the send email action to send case-related details. The challenge is copying the HR Case attachments into the email notification.

Attempt 1: OOB “Copy Attachment” Action
I tried using the out-of-the-box Copy Attachment action in Flow Designer.
Issue:
This did not work because the flow is in HR_Core scope, and I cannot access the sys_email table due to scope restrictions.
Attempt 2: Custom Flow Action – Copy via sys_attachment. Fetching the data from sys_attachment, if any record found copy that file to target table
var success = GlideSysAttachment.copy(
'sn_hr_core_case_compensation', // Source table
inputs.hr_case_sys_id, // Source sys_id
'sys_email', // Target table
inputs.email_sys_id // Target sys_id
);
The success 
value is always blank, and the attachments are not copied.

Attempt 3: Manually Writing to sys_email_attachment table using script action.
This approach also did not work.
Any guidance would be greatly appreciated.
Thanks in advance!

 

 

4 REPLIES 4

Sabrina Ethridg
ServiceNow Employee

You could use the Send Notification action instead and create the content in the Notification (sysevent_email_action) table.   On that table there is a checkbox 'Include attachments' that you can check and will include all attachments on the email.    The field may not be visible on the form layout, so you will either need to modify it from a list view or add the field to the form view

 

SabrinaEthridg_0-1770411088587.png

 

 

abirakundu23
Giga Sage

Hi @snehalkausa ,
Please create flow designer " Human Resource Core" scope application and Use event based notification with "include attachment" instead of send email in Flow designer. Notification automatically use record attachments.

Please mark helpful and correct answer if it's worthy for you.

Ankur Bawiskar
Tera Patron

@snehalkausa 

You can't include attachments using "Send Email" flow action in flow, there are challenges in that.

Please use OOTB Email notification with "Include attachment" checkbox

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@snehalkausa 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader