Export Record with Attachments and Send via Email in ServiceNow

Konstantinos Di
Mega Guru

Hi everyone,

I am trying to automate the process of exporting a record along with its attachments and sending it via email in ServiceNow. My goal is to:

  1. Export a record from a table (e.g., Legal Matter / Legal Req) as a file (CSV, PDF, or JSON).
  2. Retrieve all attachments associated with that record.
  3. Send an email with both the exported record and its existing attachments.

I’d appreciate any insights, best practices, or example scripts that can help!

Thanks in advance! 😊

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Konstantinos Di 

Not a best way to send all attachments to user via email, why not give them access to the record and they can view/download the attachments from there

Do you want to schedule this daily? what's your exact requirement.

Your requirement is feasible with custom logic and solution but will take some time to implement.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hey Ankur, 
the Customers already have access to the records. In this case they simply want it done without manual work, save some clicks. 

Ankur Bawiskar
Tera Patron
Tera Patron

@Konstantinos Di 

You can refer below link on how to generate PDF of the record and it will attach that file to the record itself.

Generate PDF and attach to the record 

Then have notification, event on your table and then use Include Attachment checkbox so that all files on that record are sent via email. This will happen out of the box.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Thanks a lot! I'll take a look into it and report back 🙂