- 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-11-2023 12:34 AM
use array of json objects
[
{
"agent": "attachmentCreator",
"topic": "attachmentCreator",
"name": "Test.pdf",
"source": "incident:sys_id1",
"Payload": "Base64 encodedstr1"
},
{
"agent": "attachmentCreator",
"topic": "attachmentCreator",
"name": "Test2.pdf",
"source": "incident:sys_id2",
"Payload": "Base64 encodedstr2"
}
]
Then parse the array of json object and then for each object use the code I shared
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-11-2023 05:21 AM
I understood that we have to pass attachments as an array .
Apologies, as I'm new to Integration I'm not getting whether we need to updated the code you provided or will it works for multiple attachments.
By seeing the code I assume it'll work for a single attachment, correct me if I'm wrong.
Also in Postman what should be the end point to be passed to test if we construct similar to this.
Thanks,
- 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