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

Quirks with case and lookups in field references in visual workflow

I’ve been running into a number of bizarre issues with field references in flows. To illustrate these, I created a simple flow with a fast lookup to contact to an sobject variable named “sovContact” and a screen to display account... Continue →