Hi it would be great if anyone could help me out with this. I have encountered a requirement in salesforce where I have to upload/insert a custom object record and its related file attachment into salesforce using a single csv file using data loader. So is there any work around to do it ? Thanks in advance.

1 Answer 1


There's no way to do this without custom development. Data Loader targets exactly one object per data load.

You'd have to build a staging table and automation to transform it into a custom object + attachment, but that's a very bad idea because you'd dramatically limit the size of the attachment you can include due to governor limits.

Abandon the idea of one Data Loader pass. Either do two passes, or script the upload, or use a middleware platform that can transform your inbound data into two API calls.

  • Thanks @david-reed for the clear explanation. Also if we gonna do it by transforming it into a custom object should we convert the attachment to base64? Oct 2, 2021 at 16:36
  • 1
    I really recommend you don't take that approach.
    – David Reed
    Oct 3, 2021 at 4:43
  • So if we are uploading the object records and related files from single csv file but two data loader passes how could we relate the records and its files in salesforce. Can we use an ExternalId field on the FirstPublishLocationId which is prepopulated in custom object record as we do not have access to the salesforce generated recordId in the csv file. @david-reed Oct 8, 2021 at 7:42
  • That's really too much to address in a comment, feel free to open a new question if you're stuck.
    – David Reed
    Oct 9, 2021 at 0:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .