Using Flow Designer, add attachment to Send Email Action

Daniel O_Connor
Kilo Guru

Hi all,

I've created a Custom App using Studio, whereby we will receive Weather Warnings from a National Weather provider, and then forward this e-mail onto relevant parties. 

I created an extension of TASK so we can have a record of these weather alerts. The e-mail that we will receive, will contain a PDF attachment, that is the details of the warning.

Through my inbound action, I'm creating a record on my new table, where the PDF will be attached to the ticket.

Through Flow (new module, not legacy workflow) I've been able to spin my flow up pretty quickly. However I see no option to include the attachment from the record, onto the e-mail I'm sending out.

find_real_file.png

Any ideas how I can accomplish this?

  • With Send Email action in Flow Designer, have the attachment from the record included in the generated email 
1 ACCEPTED SOLUTION

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Hi Daniel,

 

Bad news is that I don't think there is a OOB functionality for this. Good news are that it's very easy to solve with a custom action. Basically you create you own "copy attachment" action and then you can use that action to copy the attachment from the task record to the email-record that is used to send the email.

 

I made a quick video here for you to see what I'm talking about:

View solution in original post

27 REPLIES 27

Hi Brian,

Yeah this is working for a while now in my instance. Goran does a series of videos and he posted one above. Followed his steps and now I have attachments generating in the outbound email notification.

It's brilliant, and now in use in a number of apps. 

Hey,

I'd imagine it's the same steps I did. Follow the steps Goran has in his video. 

So I'd imagine in your Flow for when the Request item is generated, you need to add in an email step to fire out a mail with the attachments present on the submission. 

I tried your approach, but the email ends up getting sent before the Copy Attachment action has a chance to run. How do you avoid such race conditions? Thanks!

Hmm..

In that case, I guess you would need some workaround where you perhaps first put it in the ignore mailbox, and when the attachment has been copied, you can move it over to the outbox. Mostly this is controlled through the type field.

Does that make sense?

//Göran
Feel free to connect:
LinkedIn
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor's Guide To ServiceNow

Hi Goran, I'm not actually terribly clear on how to do that - the Send Email step in Flow Designer doesn't have options in terms of outbox/type, and the Create Record actions don't let me select sys_email... Though even if I could create the sys_email record, I presume I need the API to calculate the headers and so on.