Add attachment

sparkles
Tera Contributor

Hi,

 

 I am using send email action on my flow and its working fine. But I want to include the attachment on the submitted record to the email. How can I do it. 

 

Thanks,

S

4 REPLIES 4

Laveena-Agarwal
Kilo Sage

Hi @sparkles 

Configure notification to include the attachment and use this notification under " Send Notification" instead of "Send Email"

I need to use "send email" action. I am using " Make a decision" logic and getting the recipient email from it.

Rafael Batistot
Tera Sage

Hi @sparkles,

 

 

I've already dealt with a similar situation, and this helped me.

 

https://youtu.be/xYttoOtLB8U?si=tXLgY_ZG6WrMMSgk

In this video we are solving a community question. They have created a flow that sends an email and now they need to add the attachment from the task that triggered the flow to the mail being sent. You can find the question here: ...

kaushal_snow
Mega Sage

Hi @sparkles ,

Good day !!

 

If you use Flow Designer “Send Email” action, be aware that it does not support including attachments from records out-of-the-box. To achieve this, please follow these steps:


Get the attachment list:

 

Use “Get Attachments on Record” on your triggering record (Any record). This outputs a list of attachments to work with.

 

Send the email: Add a “Send Email” action, dynamically retrieving recipients. In the Data pill output, grab the “Email Record” object (the sys_email sys_id).

 

** Copy each attachment to the email record:

 

Create a custom Flow Action (e.g. Copy Attachment) whose script uses the GlideSysAttachment API to copy files.

 

var gsa = new GlideSysAttachment();
var src=new GlideRecord(inputs.srcTable);
src.get(inputs.srcTableSysId);
var att = gsa.get(inputs.attachmentSysId);
gsa.copy(src, 'sys_email', inputs.emailRecSysId, gsa.getBytes(att));

 

Give it a try and let me know..

 

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/