+ 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.