I would like to bulk upload list of pdfs as attachments against knowledge articles. I think the documents are getting stored in ContentDocument, but how can I use dataloader to load attachments and link it against knowledge articles? Thanks.


Unfortunately, I don't think you can do this in one load. ContentDocumentLink is what you need to insert that'll have a lookup to the file and the Knowledge Article. Both of those records need to exist to insert these records.

  1. Dataload the files first. These are stored in the ContentDocument type.
  2. After inserting, export the files to get the Id.
  3. Export your Knowledge Articles to get the Id of your articles.
  4. Insert ContentDocumentLink records using the ContentDocument Id for ContentDocumentId and KnowledgeArticle Id for LinkedEntityId. You'll also want to consider what values to set for Visibility and ShareType.

This obviously assumes you'd have an ability to figure out which file should go with which article based on the fields you have available (ex. title, file name). If you can't, I'm not sure you have another option.

  • Thank you Kris. I figured it out. Since articled will be attached to only one knowledge article, I did that with one single data load stepe i.e. loading into ContentDocument by providing the FirstPublishLocationId = Knowledge Article ID – Sudipta Deb Mar 19 '20 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.