function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DJ Rock your own styleDJ Rock your own style 

Export attachments using dataloader

Hi,

 

Is it possible to export attachments for only a particular object in dataloader? I ve been trying this but no luck as yet. It is exporting all attachments available in the instance irrespective of which object record it is associated with. Tried for the following queries also but didnt help:

 

SELECT Id, Parentid from attachment where parentid like 'a0v%' (a0v is the object id I need to export from)

or

SELECT Id, Parentid from attachment where parentid like '%a0v%'

or

SELECT Id, Parentid from attachment where parentid like :'a0v%'

 

Please help me out.

 

Thanks and regards,

Dave

Jia HuJia Hu
try
SELECT Id, Parentid from attachment where parent.type = 'account'
banderson5144Devbanderson5144Dev

The best way to get the actual attachment data out of Salesforce is to query the Attachment object for the Attachment Ids and then use the retrieve() api call to get the Body data. I have done this before for integrations and it is very fast.