0

I start at the Opportinities object, get the id of quotes, pass quotes documents and go to content Documents, but I can't find the object link so I can download the attached pdfs. I'm doing everything by Power Automate

I tried in several ways, I tried to get to Attachment, Documents and I couldn't

1 Answers1

0

It's unlikely your files are stored as Attachments, that table is old and more fit to Salesforce Classic. You could try SELECT Body FROM Attachment WHERE ParentId = '006...' but I'd expect 0 results.

Use the approach from my answer https://stackoverflow.com/a/74897406/313628 (I can't mark the question as duplicate because nobody upvoted it ;))

Your actual payload is hidden in ContentVersion table, VersionData field. It's a related list under ContentDocument but for your purposes probably fetching

SELECT ContentDocument.LatestPublishedVersion.VersionData 
FROM ContentDocumentLink 
WHERE LinkedEntityId = '006...'

is enough.

Now... what you will see in VersionData depends on which API you are using. Over REST API the field will simply contain 1 more link you need to pull (HTTP GET) to get the raw binary/text payload. Over SOAP API it'll return and XML document with the payload as 1 of the fields, base64-encoded. https://stackoverflow.com/a/60284736/313628

eyescream
  • 18,088
  • 2
  • 34
  • 46