- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 06:21 AM
Hello All,
I got a requirement where I need to attach multiple attachments to the job record at a time.
I have used '"AttachmentCreator" but it's not allowing me to attach multiple attachments at a time to record.
Could anyone please help me with your inputs to accomplish this functionality.
Thanks,
Raj
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2023 05:23 AM
you need to enhance the script I shared so that it iterates the array of json objects and then for each object use attachment creator
I hope that helps you
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 06:28 AM
So 3rd party will send the attachment data?
you can use Scripted REST API and inform 3rd party to send data as per this format and ensure they send all the data at once when they hit the API
refer this link and enhance your logic
Scripted Rest API to update incident with attachment
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 11:38 PM - edited 10-10-2023 11:39 PM
Hi @Ankur Bawiskar ,
Thanks for providing quick response on this.
In my Instance file format we are using is Pdf, as you stated in other chain mentioned below do we need to use Attachment creator only?
for other file you can use SOAP Attachment creator and you require the following details
file name, content type, base64encoded data, record sysId, table name
Thanks,
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 11:41 PM
you can use Attachment Creator or GlideSysAttachment API as well
what did you start with and where are you stuck?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2023 11:49 PM - edited 10-11-2023 12:03 AM
I used attachment creator as below
{
"agent" : "attachmentCreator",
"topic":"attachmentCreator",
"name":"Test.pdf",
"source":"incident:sys_id",
"Payload":"Base64 encodedstr"
}
I used the above format and the attachment is getting attached to the record.
Now My question is can multiple attachments can be send in a single api request.
Thanks,
Raj