Skip to main content
Conga Support

Merging Images from Salesforce Files

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.  In the example below, we will call it 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:
    1. 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}'
  3. Use Detail Regions and the IMAGE special merge field to merge the image into the template.  An example in Microsoft Word: