Need to access images within objects and records? No problem, but first we need to get a few things ready before we proceed.
Upload Images to Files Tab - Start by going to the ORG Homepage and click into the Files object page.
Click on the “Upload Files” button, select all the images to upload and click Open.
Note: Make sure to re-size images before uploading them to ensure they size within the desired template.
Complete the upload by pressing the “Done” button.
Uploaded image files should now show within the Owned by Me Files.
Obtain File ID for each file uploaded by locating the file, clicking on the drop down arrow to the right and selecting View File Details from the drop down list.
Note: Repeat process for each image uploaded.
On top of the page, find the URL with the embedded file ID.
Note: Right after the ContentDocument/ you will find 15-18 alphanumeric characters. Go ahead and copy as this will be the ID used to identify this file. Each file has its own unique file ID. Uploading a copy of the same file will create a new file ID. In order to preserve the file ID for an existing file you must update using the Upload New Version option.
Create a Custom Text Field within the object page you want to generate the Mambo Merge template from.
Note: For this example we will be creating a new field within the Opportunities object page. By choosing Opportunities tab then going to the Setup wheel and clicking on Edit Object.
On the left-hand navigation menu select Fields & Relationships and click on New.
Select Text for field type and click Next.
Next you will create a Field Label and Length. The Field Name automatically gets generated upon entering a field label. Click on Next.
Note: Description and Help Text are optional to summarize the purpose of the field. We called our field Opportunity Image and gave it a text field length of 40.
Setup which user profiles have visibility or read-only access to this field. Click Next when you are ready to proceed.
Note: Typically all profiles have visibility unless access needs to be restricted to select profiles.
Last step to complete the custom field is to identify which pages will this field apply to. Select all that apply and press Save.
Note: For this example we are allowing the field to apply to all pages identified.
Done! Now your field should appear within the Object page it was created from.
Uploading File ID’s to Custom Text Field (Reference Step 5 to obtain File ID’s for each image file uploaded to the Files Tab)
Note: For this example we are now going to go back to our Opportunities tab and choose a opportunity to Edit.
Next will go to the custom text field created and paste-special (paste plain text) the image ID.
Note: The custom field name for this example is Opportunity Image.
Once paste is done, click on Save.
Now we are ready to access this image within a word DOCX template by using the custom field name and IMAGE() function. Go to the object page you want to generate your document from.
Note: We are using the Opportunities page for this example and have an opportunity record opened with an instance of Mambo Merge already installed.
Locate the merge field name for the custom field generated by going to the Mambo Merge instance, click on the down arrow and select Template Builder.
Choose the Object and Field combination for the custom field.
Note: For this example our object is Opportunity and field name is Opportunity Image. The merge field needed to add within our DOCX template is {{Opportunity_Image__c}}.
Next we want to use the IMAGE() function with the merge field obtained as below. {{IMAGE(Opportunity_Image__c)}}.
Note: Must be using Mambo Merge Pro edition for IMAGE() function to work. For this example we are using Google Docs to generate the word doc.
Save the File and Upload it to the Mambo Merge instance within the Opportunity page.
Note: You can also drag and drop the file within the Mambo Merge instance.
A File Generated Successfully notification will appear on the top.
Go ahead and open the downloaded file to see the output of the merge field with IMAGE() combination.
Note: As you can see the image that was mapped to the opportunity record using the custom field appears.
Even though the process may seem like a lot it really comes down to the following key steps.
Upload Image files to the Files tab
Make sure to re-size images based on output requirements
Obtain File ID for each file uploaded
Create a Custom Field to house File ID’s
Upload File ID to custom field
Use IMAGE() function and custom field within Merge Field Template
Customize Template as needed for output