- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Experts,
I need an api from the ServiceNow to add the multiple attachments to the incident record
I checked in the Api explorer but no luck.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
ServiceNow OOTB Attachment API doesn't support multiple files
You can create Scripted REST API and ask 3rd party to send array of JSON object and then handle it using customization.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Ankur Bawiskar ,
Thank you for the response. I am trying to create the attachment using the AttachmentCreator in the ecc queu. Using the below code create an attachment but the problem is for docs and excel it is not working.
var parentTable = '<table_name>';
var parentRecord = '<table_sys_id>';
var ecc = new GlideRecord('ecc_queue');
ecc.agent = 'AttachmentCreator';
ecc.topic = 'AttachmentCreator';
ecc.source = parentTable + ':' + parentRecord;
ecc.name = '<file_name>:<mime_type>';
ecc.payload = '<base_64_encoded_file_content>';
ecc.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
In my PDI
for docx I could see it's -> application/vnd.openxmlformats-officedocument.wordprocessingml.document
for excel (xlsx) I could see it's -> application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
MIME type for
docx-> application/vnd.openxmlformats-officedocument.wordprocessingml.document
doc (Word 97-2003)-> application/msword
xlsx-> application/vnd.openxmlformats-officedocument.spreadsheetml.sheet OR application/xlsx
xls (Excel 97-2003)->application/vnd.ms-excel
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
