exporting files using xappex

xappex doesnt have good documentation on exporting files, but they make it pretty easy, you just need to do it in two steps.

their docs say

“Now, any time you include a field of type base64 in your SOQL Query – it will be converted to a file and saved at this location”

but this not entirely true. On a support ticket they clarified:

“VersionData only comes down as an actual file when it’s queried directly from ContentVersion, pulled through a relationship it arrives as text,”

so this query doesnt work, it returns text

SELECT LinkedEntityId,ContentDocument.LatestPublishedVersionId, ContentDocumentId,ContentDocument.Title,ContentDocument.LatestPublishedVersion.Title,ContentDocument.LatestPublishedVersion.VersionData
FROM ContentDocumentLink
WHERE LinkedEntityId = ‘006Ui00000biDgmIAE’

the approach that works

query 1: gets the LatestPublishedVersionId from contentDocumentLink and stores the data to a worksheet
query 2: gets the contentVersion using IN (excel rows) against LatestPublishedVersionId

Note: if you reference the sheet column ie A:A then it throws an error for the header row

the proper format is where Id IN [@TableName[ColumnName]]

 
0
Kudos
 
0
Kudos

Now read this

Manipulating text in flows

i occasionally need to iterate over a list of records in a sObject collection, and display values from the records in a screen. back in the day i got some crucial help from salesforce yoda / mark ross on this developerforce post, which... Continue →