Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

How to download the attachment from Salesforce attachment table.

5 - Atom

hi,

I have a requirement where I need to download the attachment from Salesforce. I ran the query from the Attachment table. I can see the details like file name, etc from the below column.

cghat_0-1575305508967.png

 

I am not sure how to download the files or retreive the data from the file name.

Highlighted
Alteryx
Alteryx

I'm not sure if attachments can be downloaded directly from the SalesForce input tool (someone please correct me if this is possible). However, SalesForce has the SObjects API endpoints where attachments can be downloaded from: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_blob_retr... 

 

Here is an example of using this endpoint for pulling an attachment: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_blob_retrieve.... 

 

This Alteryx link covers how to do it: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Salesforce-blobs/td-p/31200 

 

 

 

This comment in particular: 

 

ParentIdIdNameContentTypeBody
001a000001JsueBAAX00Pa000000cuTnJXXX Cover.jpgimage/jpeg

/services/data/v20.0/sobjects/Attachment/00Pa000000cuTnJXXX/Body


  • Then get your Bearer access token
  • Your image_url will be [instance_url]+[Body] or 

https://csXX.salesforce.com/services/data/v20.0/sobjects/Attachment/00Pa000000cuTnJXXX/Body

 

 

So I think that you could pull the authentication step out of the deprecated SalesForce macro to get your bearer token and then pass that into a subsequent download tool to pull all of the files that you need. 

Labels