cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cymorg1
Advocate II
Advocate II

Downloading files from Salesforce

I'm trying to download file(s) attached to a custom entity in Salesforce and save them into SharePoint.  The file(s) seem to be saved in ContentVersion.VersionData however when I query this in Power Automate I get a partial URL (e.g. /services/data/v47.0/sobjects/ContentVersion/06809000002nZMJBB5/VersionData).  The ContentVersion contains all the file metadata like file extension, size, date created etc. but it doesn't contain the file content itself.  ContentVersion also contains an item called ContentBodyId which, when used to query the ContentBodies entity in Salesforce returns an error 

entity type ContentBody does not support query\r\nclientRequestId: 32143983-a2bb-4f01-b04e-a85b8ec5d2aa

So, where does the blob data for a file exist in Salesforce, and how can I retrieve it using Power Automate? 

1 ACCEPTED SOLUTION

Accepted Solutions
ResidentGeekUK
Frequent Visitor

Hi cymorg1,

 

I have been trying to figure out EXACTLY this solution as well.  You have to make a REST call to Salesforce to actually get the binary of the document.

After MUCH searching I found this brilliant article by Vivek Shukla on LinkedIn which after very carefully reading, re-reading and a bit of trial and error has given me a working example just this morning (I need to extend it to extract extra metadata and so on as efficiently as possible, but it works perfectly).  Be sure to follow it to the letter and also follow the article on connecting to Salesforce with Postman that he links to.

(7) SharePoint Online and Salesforce Integration Including Attachments | LinkedIn

How to connect to Salesforce with Postman ? - SFDC Stop

View solution in original post

1 REPLY 1
ResidentGeekUK
Frequent Visitor

Hi cymorg1,

 

I have been trying to figure out EXACTLY this solution as well.  You have to make a REST call to Salesforce to actually get the binary of the document.

After MUCH searching I found this brilliant article by Vivek Shukla on LinkedIn which after very carefully reading, re-reading and a bit of trial and error has given me a working example just this morning (I need to extend it to extract extra metadata and so on as efficiently as possible, but it works perfectly).  Be sure to follow it to the letter and also follow the article on connecting to Salesforce with Postman that he links to.

(7) SharePoint Online and Salesforce Integration Including Attachments | LinkedIn

How to connect to Salesforce with Postman ? - SFDC Stop

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (2,964)