# Retrieving Blobs From SalesForce

**URL:** <https://connective.celigo.com/t/retrieving-blobs-from-salesforce/32>\
**Category:** Integrator.io\
**Tags:** http, salesforce\
**Created:** [July 17, 2024, 8:43pm UTC](https://connective.celigo.com/t/retrieving-blobs-from-salesforce/32 "2024-07-17T20:43:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveguderian](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@daveguderian](https://connective.celigo.com/u/daveguderian)\
**Post date:** [July 17, 2024, 8:43pm UTC](https://connective.celigo.com/t/retrieving-blobs-from-salesforce/32/1 "2024-07-17T20:43:20Z")

</div>

What is the best way to retrieve a blob from Salesforce. It seems this may require an http connection in order to retrieve this and may not be feasible using the standard Salesforce connector. From what I read online it would appear a request like below would be needed to retrieve the blobkey.

Thanks!

```
https://yourInstance.salesforce.com/services/data/v54.0/sobjects/ContentVersion/068Pn00000CuiibIAB/VersionData
```

---

<div class="post-metadata">

**Author:** ![daveguderian](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@daveguderian](https://connective.celigo.com/u/daveguderian)\
**Post date:** [July 18, 2024, 2:40pm UTC](https://connective.celigo.com/t/retrieving-blobs-from-salesforce/32/19 "2024-07-18T14:40:30Z")

</div>

As a follow-up to this, I wanted to provide a sample payload. Im just not sure the best way to retrieve the blob as I believe it would require a GET request, but didnt know if I could do that with an integrator.io connection or would need an http connection specifically to our Salesforce environment.

As always, thanks for any input!

```
{ "page_of_records": [{ "record": { "attributes": { "type": "ContentDocumentLink", "url": "/services/data/v54.0/sobjects/ContentDocumentLink/06APn00000DmPr4MAF" }, "ContentDocumentId": "069Pn00000CWDfxIAH", "LinkedEntity": { "attributes": { "type": "Name", "url": "/services/data/v54.0/sobjects/Product_Document__c/a8zPn0000000Vi9IAE" }, "Name": "Plan Brochure Outline - Dental & Vision" }, "ContentDocument": { "attributes": { "type": "ContentDocument", "url": "/services/data/v54.0/sobjects/ContentDocument/069Pn00000CWDfxIAH" }, "Title": "Plan Brochure Outline - Dental & Vision", "LatestPublishedVersionId": "068Pn00000CuiibIAB", "LatestPublishedVersion": { "attributes": { "type": "ContentVersion", "url": "/services/data/v54.0/sobjects/ContentVersion/068Pn00000CuiibIAB" }, "Title": "Plan Brochure Outline - Dental & Vision", "VersionData": "/services/data/v54.0/sobjects/ContentVersion/068Pn00000CuiibIAB/VersionData" } }, "LinkedEntityId": "a8zPn0000000Vi9IAE" } }]}
```

---

<div class="post-metadata">

**Author:** ![kellyizer](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/kellyizer/32/4369_2.png) [@kellyizer](https://connective.celigo.com/u/kellyizer)\
**Post date:** [July 19, 2024, 9:51pm UTC](https://connective.celigo.com/t/retrieving-blobs-from-salesforce/32/20 "2024-07-19T21:51:14Z")

</div>

Dave it is possible to retrieve a salesforce file without using an HTTP connector.

To get a Salesforce file you will have to get the contentVersion and then do a TRANSFER to get the lastest document version.

In this demo I am pulling an Opportunity with 2 files attached.

Then getting the document details so that I can get the latest document version and then pulling the actual blob and posting it to an FTP site.

Note that in my demo I explicitly set the Opportunity ID in my SOQL but if you had multiple opportunities you would have to modify the flow accordingly to pass in the opportunityIDs dynamically

Here is a video showing the process:

[https://app.screencast.com/jdauLDDvuabvx](https://app.screencast.com/jdauLDDvuabvx)

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [July 20, 2024, 12:56am UTC](https://connective.celigo.com/t/retrieving-blobs-from-salesforce/32/21 "2024-07-20T00:56:08Z")

</div>

@daveguderian I'm not sure your full use case, but I created a flow to export all documents on a delta that are attached to opportunities. You would just need to put a final file provider import step to upload the blob to its final destination. Also, if you are using something besides opportunities, you can change the SOQL query filter on the export. Here is the [template](https://integrator.io/marketplace/installTemplate/preview/669b09d38e4c47cda127e5d4).

P.S. thanks to @kellyizer for doing the leg work here!

---

<div class="post-metadata">

**Author:** ![daveguderian](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@daveguderian](https://connective.celigo.com/u/daveguderian)\
**Post date:** [July 22, 2024, 1:53pm UTC](https://connective.celigo.com/t/retrieving-blobs-from-salesforce/32/22 "2024-07-22T13:53:16Z")

</div>

Hey Tyler and Kelly-

Thank you both SO much for this. I am still working through this today.

My first question is why are my options different than what I see in Kelly's video and Tyler template when I select TRANSFER (note how the "Operation" is limited to Insert, Update, Upsert)? This to me looks like integrator.io is asking me where I want to transfer/update records INTO Salesforce and not pull from. Do I need to save this step and then re-open to see what you both had?

 ![5301043caa20740200000001-19c44c5c1efb453da34136700d42e94c.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/0/0e475eb9bf135b08dab818ea5b3b8517c58166f2.png)

---

<div class="post-metadata">

**Author:** ![daveguderian](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@daveguderian](https://connective.celigo.com/u/daveguderian)\
**Post date:** [July 22, 2024, 2:06pm UTC](https://connective.celigo.com/t/retrieving-blobs-from-salesforce/32/23 "2024-07-22T14:06:12Z")

</div>

Also, Tyler I did want to add on that the ultimate destination for these files are AWS S3.

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [July 22, 2024, 3:21pm UTC](https://connective.celigo.com/t/retrieving-blobs-from-salesforce/32/24 "2024-07-22T15:21:34Z")

</div>

@daveguderian it's "look up additional files (per record)" and not "transfer files into destination application" like @kellyizer stated.

---

<div class="post-metadata">

**Author:** ![kellyizer](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/kellyizer/32/4369_2.png) [@kellyizer](https://connective.celigo.com/u/kellyizer)\
**Post date:** [July 22, 2024, 6:07pm UTC](https://connective.celigo.com/t/retrieving-blobs-from-salesforce/32/25 "2024-07-22T18:07:59Z")

</div>

Dave,

Here is an updated video posting the files to S3 and also highlighting the "Lookup additional files per record" options versus "Transfer" I was just using that as an example to show that you can use the transfer option in the Salesforce connector versus needing a HTTP connection. sorry for the confusion

[https://app.screencast.com/DBSXMg3Tu7oUJ](https://app.screencast.com/DBSXMg3Tu7oUJ%C2%A0%C2%A0)
