To retrieve the ContentVersion ID associated with a Contact's profile picture, you need to build a Multi-Step Report (MSR). This is necessary because the ContentVersion record is not directly related to the Contact; it must be accessed through the intermediate ContentDocumentLink object.
The recommended approach is to create a Multi-Step Report using the following object relationship:
Contact → ContentDocumentLink → ContentVersion
First, link the Contact record to the associated ContentDocumentLink record. Then, use the linked ContentDocument to retrieve the corresponding ContentVersion record and its ID.
Once the ContentVersion ID is available in the report, map that field to the image merge field in the document template using the @IMAGE merge syntax. During the merge, Apsona automatically uses the ContentVersion ID to locate the associated image file and renders it in the generated document.
When working with images stored in Salesforce Files, always use the ContentVersion ID rather than a file URL, as Apsona's merge engine retrieves the image directly from Salesforce using the ContentVersion record.