Add dynamic images to output

Available only with Enterprise Edition

You can add images to output documents from Salesforce records, and even resize the image (if necessary). You set up a field to hold images on records, then reference the field with a tag in your template. When the user generates documents, the app adds the image to output documents.

Tip: If you want to add images to Microsoft Word templates for email messages, use the procedure in Email templates.

Pull images from a Salesforce record into output documents

First you set up Salesforce, then you configure your template. The steps for configuring the template are a little different depending on the Microsoft Office program you're using, but this process works across all the supported Microsoft products. Here is a high level overview of the steps.

  1. Add a Rich Text field to an object

  2. Add an image to a record

  3. Configure the template

  4. Generate documents

Note: Microsoft Word, Microsoft Excel and Microsoft PowerPoint templates support this method of inserting images.

Add a Rich Text field to an object

In Salesforce, you add a Rich Text field to the object from which you want to generate documents.

To add a Rich Text field to an object in Salesforce Classic

  1. From Setup, take one of the following actions: 
    • If you're working with a standard object, type the name of the object in the Quick Find box, then click Fields.

      For example, if you wanted to add a Rich Text field to the Account object, you would click Fields under Accounts.

    • If you're working with a custom object.

      1. Type Objects in the Quick Find box, then click Objects.

      2. Click the custom object you want to work with.

        For example, if you wanted to work with a custom object named Call, you would click Call.

  2. In Custom Fields & Relationships, click New.

    Note: If you're working with a standard object, the name of the object appears in the Custom Fields & Relationships label. For example, Account Custom Fields & Relationships.

  3. In Data Type, select Text Area (Rich) and click Next.

  4. Add required fields (Field Label, # Visible Lines, Field Name), any optional fields, and then click Next.

  5. (Optional) Add field-level security and then click Next.

  6. Select one or more page layouts on which to add the Rich Text field.

  7. Click Save.

For more information about adding a custom field, see Create Custom Fields in Salesforce Help.

Add an image to a record

Add an image to the Rich Text field, so that you can have the image pulled into the template when users generate documents. You can upload an image from your computer or link to an online image with a URL.

To add an image to a Rich Text field in Salesforce Classic

  1. On the object to which you added the Rich Text field, open a record.

    For example, from Accounts, click Burlington Textiles Crop of America.

  2. In Account Detail, click on the Rich Text field you added to open it in edit mode.

    For example, click NIntex Image (Rich text).

  3. Click the image icon.

    The Insert Image dialog box opens.

  4. In Insert Image, take one of the following actions:

    • If you want to upload an image from your computer, click Choose File, select an image from your computer, and then click Open.

    • If you want to add an online image, click Web Address and type the URL to the image into URL.

  5. Click Insert.

  6. Click Save.

Configure the template

You add a placeholder image to your template. When the user generates documents, the app replaces the placeholder with the image from the record. If the image on the record is a different size than the placeholder image, the app sizes the image from the record to match the size of the placeholder.

Note: You can configure a Microsoft Word, Microsoft Excel, or Microsoft PowerPoint template.

To configure a Microsoft Word template

  1. In Microsoft Word, place the cursor where you want the image from the Rich Text field in to appear.

    Note: You can add images to the header in Microsoft Word.

  2. Click Insert and then click Pictures.

  3. Select a placeholder image and click Insert.

    Tip: To prevent a skewed image, the placeholder image should be the same orientation and aspect ratio of the image in Salesforce.

  4. From the Field tagger on a DocGen Package in Salesforce, in Main Object, select the object to which you added the Rich Text field, and then select the Rich Text field you added to the object.

    For example, in Main Object select Account and in Field select Nintex Image (Rich text).

  5. In Document Type, select Word/PowerPoint.

  6. Copy the tag in Tag to the clipboard of your computer.

    For example, on Microsoft Windows, select the tag and press Control and C. On a Mac, press Command and C.

  7. In Microsoft Word, double click the placeholder image.

  8. Click Select, and then click Selection Pane.

  9. In Selection, double-click the reference to the placeholder image, paste the tag from your clipboard, then edit the tag to include __image inside the angle brackets.

    For example:

    • Before

      <<Account_Nintex_Image_Rich_text>>

    • After

      <<Account_Nintex_Image_Rich_text__image>>

  10. Save your template then add the updated template to the DocGen Package.

    For more information on adding a template to a DocGen Package, see Adding template files to DocGen Packages.

To configure a Microsoft Excel template

  1. In Microsoft Excel, place the cursor where you want the image from the Rich Text field in to appear.

  2. Click Insert and then click Pictures.

  3. Select a placeholder image and click Insert.

    Tip: To prevent a skewed image, the placeholder image should be the same orientation and aspect ratio of the image in Salesforce.

  4. From the Field tagger on a DocGen Package in Salesforce, in Main Object, select the object to which you added the Rich Text field, and then select the Rich Text field you added to the object.

    For example, in Main Object select Account and in Field select Nintex Image (Rich text).

  5. In Document Type, select Word/PowerPoint.

    Caution: Typically you would select a Excel/PDF as the Document Type, but to tag images in placeholders in Microsoft Excel, you must use angle bracket tags.

  6. Copy the tag in Tag to the clipboard of your computer.

    For example, on Microsoft Windows, select the tag and press Control and C. On a Mac, press Command and C.

  7. In Microsoft Excel, double-click the placeholder image, and then click Selection Pane.

  8. In Selection, double-click the reference to the placeholder image, paste the tag from your clipboard, then edit the tag to include __image inside the angle brackets.

    For example:

    • Before

      <<Account_Nintex_Image_Rich_text>>

    • After

      <<Account_Nintex_Image_Rich_text__image>>

  9. Save your template then add the updated template to the DocGen Package.

    For more information on adding a template to a DocGen Package, see Adding template files to DocGen Packages.

To configure a Microsoft PowerPoint template

  1. In Microsoft PowerPoint, place the cursor where you want the image from the Rich Text field in to appear.

  2. Click Insert and then click Pictures.

  3. Select a placeholder image and click Insert.

    Tip: To prevent a skewed image, the placeholder image should be the same orientation and aspect ratio of the image in Salesforce.

  4. From the Field tagger on a DocGen Package in Salesforce, in Main Object, select the object to which you added the Rich Text field, and then select the Rich Text field you added to the object.

    For example, in Main Object select Account and in Field select Nintex Image (Rich text).

  5. In Document Type, select Word/PowerPoint.

  6. Copy the tag in Tag to the clipboard of your computer.

    For example, on Microsoft Windows, select the tag and press Control and C. On a Mac, press Command and C.

  7. In Microsoft PowerPoint, double click the placeholder image and then click Selection Pane.

  8. In Selection, double-click the reference to the placeholder image, paste the tag from your clipboard, then edit the tag to include __image inside the angle brackets.

    For example:

    • Before

      <<Account_Nintex_Image_Rich_text>>

    • After

      <<Account_Nintex_Image_Rich_text__image>>

  9. Save your template then add the updated template to the DocGen Package.

    For more information on adding a template to a DocGen Package, see Adding template files to DocGen Packages.

Generate documents with images from the record

You can generate documents and the app replaces the placeholder images with the image in the Rich Text field. The image in the Rich Text field appears in the output documents, sized to whatever the size of the placeholder image had been.

To generate documents with images from a Rich Text field

  1. Click Select Record from a DocGen Package that contains templates with tags for images pulled from a Rich Text field, select the record, contact, and then select the Test Download. For more information, see DocGen Package object testing

  2. Click Run DocGen Package.

  3. Download the output file. The placeholder image has been replaced with the image from the Rich Text field.

Related information

Add dynamic images to output with button parameters