How can I do a Bulk upload of attachments?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2014 07:05 PM
I need to migrate some change request data from another system. I have the change requests and their related attachment data ( CR, attachment name) in csv extracts. The attachments themselves are in a folder. I was planning to use import set to import the csv data but then I don't know how to handle the attachment files. What is the the best way to import these attachments and relate them to the change requests?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2015 10:05 AM
Hi Venkatesh, there's a really cool trick to handle the attachment files and associate these with a record in ServiceNow
Through the agent "AttachmentCreator", the ecc_queue can process and associate an attachment to a given record within ServiceNow. The fields of the ecc_queue entry will need to be the following:
agent = 'AttachmentCreator'
topic = 'AttachmentCreator';
name = 'file.csv:plain/text'; // this will be in the form fileName:ContentType
source = 'table:sys_id'; //replace with the table and the sys_id of the record on which the attachment needs to be placed on
payload = GlideStringUtil.base64Encode(fileContent); //replace the fileContent with the content of your file in a string format.
With this you now can load into ServiceNow a file on which in one column you have the fileName, in another one a key to the reference record where you want to do the insert and then in another column the text of the csvs and then perform a transform where the data goes into the ecc_queue and it's attached to each respective record.
Lets touch base and I can further help you with it!
Thanks,
Berny

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2017 02:23 AM
I removed this function GlideStringUtil.base64Encode and copied the base 64 content to payload, then it worked fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2018 02:43 AM
Hi Berny,
I have a similar requirement. Could you please explain the steps to achieve it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2020 10:26 PM
I definitely need your help bernyalvarado. Hope I can still find you avaialble...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2022 06:58 AM
Hi Berny,
I have the same requirement wherein user needs to migrate data alongwith attachment. Can we achieve this via transform maps?