To insert an image, use the IMAGE function. Please be aware that all images must be saved under the Files tab. For more information visit the Before you Begin: Images section in this user’s guide.
Before including the image function in your merge document, be sure of the following:
- The image is uploaded and saved to your “Files” tab.
- A Document Data Provider for that image has been created. See the “Document Data Provider” section in the Administration Guide for how to create a Document Data Provider.
- The name of the Document Data Provider is included in your query at the top of your merge document. Otherwise the image function will fail.
Note: Please note that all functions are case sensitive!
The syntax for the image function is as follows:
Note: The ContentDocument ID is required for all images. No other ID is accepted by the template engine. Therefore, please be sure to use the ContentDocument ID, not the ContentVersion ID.
Note: To store an image on your record, such as a product image on your product record, write the ContentDocumentID in a custom text field. This is a workaround, since a lookup to an image is not currently possible in Salesforce. To find the SalesforeID of the image, navigate to your image in Salesforce, click on “View File Details”, and find the ID in the URL, as shown here:
To configure this workaround:
- Create a custom field (a field “ProductPicture__c” on your Product object, for example). Be sure to make this field editable and put on the appropriate page layout for the person responsible for adding the images to the records.
- Upload the image to your Files tab as described in the “Before You Begin: Images” section of the Administration Guide.
- Copy the Salesforce ID, navigate to your record, and enter the Images picture ID in the field.
- Save the record.
- Repeat steps 2-4 for each record which should have an image.
- Now you can reference the image in a merge field using this syntax:
In our quote example, it includes the $ symbol, because it is included in a loop and looks like this:
This example shows the Product picture for a Quote Line Items loop. To learn more about loops in your merge template, read the following section on the FOR() function.