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

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
Regular 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
Regular 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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,634)