Skip to main content
Conga Support

Merging Images from Salesforce Files

You can merge images from Salesforce Files in Conga Composer.

 We highly recommend queries and formulas are copied and pasted into supported Text Editors. Ensure single-quote marks are used. Avoid curly brackets and double-quote marks.

To merge an image from Salesforce Files:

  1. Build a custom formula field on the Salesforce Files Object to form a URL to the Content document:
    1. Navigate to Setup > Build > Customize > Salesforce Files > Field.
    2. Create a new formula Field. For example, Field Image URL:

      LEFT( $Api.Enterprise_Server_URL_100, FIND( ".com", $Api.Enterprise_Server_URL_100 ) + 4)& "sfc/servlet.shepherd/version/renditionDownload?rendition=THUMB720BY480&versionId=" & Id & "&operationContext=CHATTER"

  2. Write a Conga query to retrieve the formula field.

Use the dot syntax to go from the ContentDocumentLink Object up through the ContentDocument through the LatestPublishedVersion Object to retrieve the custom formula:

SELECT ContentDocument.Latestpublishedversion.Field_Image_URL__c
FROM ContentDocumentLink WHERE LinkedEntityId = '{pv0}'

Use Detail Regions and the IMAGE special merge field to merge the image into the template.  For example in Microsoft Word: