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

Including Case Comments in Case Assignment Email

Including case comments in the case assignment email allows the recipient to see exactly what is going on before even logging in to Salesforce. You need a visualforce email template for this. You can use an apex:repeat component in your... Continue →