I have 40k PDF's in windows shared drive. Each pdf should be attached to parent account. The name of each pdf is an external ID in salesforce. e.g AA123.pdf corresponds to AccountRecordId '0015C00000OaTWhQAN' AA456 corresponds to AccountRecordId '0015C00000OaRWhAVN'

My question is when i prepare my csv to be uploaded via Dataloader, how can i get the path of each pdf without having to type the path ?

e.g path of AA123.pdf is S:\IT\Database\Attachments\Extracts\AA123.pdf

Is there any utility program or do i have to write a script that will go through each pdf in the folder, extract the absolute path and create a csv. ?

  • does my answer solve your issue? – ytiq Jan 18 at 13:04

When you upload Files there is "PathOnClient" field I think, you specify it and DataLoader will use it as a location for a file. You upload those files as ContentVersion and then to link them with the account you separately upload ContentDocumentLink records. Keep in mind that you can upload ~100k Files a day enter image description here enter image description here

P.S. after you upload files result "success" file should contain Ids and Names for your files, so there should be no problem for generating upload file for ContentDocumentLink

| improve this answer | |
  • I think I did not pose my original question correctly. The .csv that i need to upload should have the path of each of the attachments. I would like to automate the creation of csv file. i.e one column will have the name if the file and other will have the path of the file. – user4947 Jan 20 at 15:19
  • Do you have your files on your computer that you want to upload? – ytiq Jan 21 at 7:46
  • yes I have the files on my computer that i want to upload – user4947 Jan 23 at 22:44
  • So you specify pass to them in your CSV file and this path info into PathOnClient – ytiq Jan 24 at 13:08
  • I don't quite understand what you mean. – user4947 Jan 24 at 15:36

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.