Add dynamic images in templates

Dynamic images let users include record-specific images such as pictures, signatures, or logos without updating the template for each document. To use dynamic images Any image related to a record. in output documents from Salesforce records Salesforce says, "A single instance of a Salesforce object. For example, “John Jones” might be the name of a contact record.", you can set up a rich text field on the records, then reference the field with a tag in your template A document/file that can be added to a DocGen Package. Data can be filled into the document/file.. When you generate the document, Nintex DocGen adds this image to your output document.

To watch video tutorials on how to use this Nintex capability, take the Certification: Nintex Document Generation Expert - Nintex DocGen for Salesforce in Nintex University.

Use images from Salesforce records for output documents

You'll need to set up your dynamic images in Salesforce first before configuring your template. The configuration process may differ slightly depending on the program you're using, but this process works across all the supported Microsoft Office programs. You'll also need to enable connected apps with OAuth to use dynamic images.

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

Add Rich Text fields to objects

Add Rich Text fields A field where users can format the field content and add images and hyperlinks. to the object you want to generate documents with:

  1. In Salesforce, click Setup.
  2. Search for Object Manager in the Quick Find box, then select an object.
  3. Click Fields & Relationships, then click New.
  4. Under Data Type, select Text Area (Rich), then click Next.
  5. Type in the required fields.
  6. Click Next.
  7. Establish the field-level security, then click Next.
  8. Select one or more page layout options to add to the Rich Text field.
  9. Click Save.

Add images to Rich Text fields

Add images to Rich Text fields in your accounts within your object. You can add images directly from your computer or using an image URL.

  1. Open the object to which you added the Rich Text field. This example uses the Opportunity object.

  2. Select an Opportunity.

  3. In the Details tab, scroll to the Rich Text field.
  4. Click the pencil icon Edit to edit the Rich Text field.
  5. To insert an image, perform one of the following actions:
    • If you want to upload an image from your computer:

      1. Click the image icon .
      2. Select an image from your computer, then click Open. Your image will appear in the Rich Text field box.
    • If you want to add an image from the Internet:

      1. Click the link icon .

      2. Enter the URL for the image.

      3. Click Save.

Add images in Snippets

You can add an image to a snippet to make it reusable across multiple DocGen Packages. To add an image to a snippet:

  1. Open the Apps Launcher, click View All and search for DocGen Snippets.

  2. Select New or open an existing snippet to which you want to add an image.

  3. Click the Image icon on the ribbon of the Body section.

  4. Upload the image from your files and click Save.

    Note: Adding an image from a Snippet Group might result in the image being distorted.

For more information, see Add an image to a Snippet. For information on creating and using snippets, see Add snippets and snippet groups.

Configure Microsoft template

Add images to Microsoft Word, Microsoft Excel, and Microsoft PowerPoint templates. A generated document will replace the placeholder with the image.

Set up Microsoft templates to include dynamic images

The steps below are the same across the three Microsoft applications.

  1. Select a file in a Microsoft application and place the cursor where you want the image to appear from the Rich Text field.
  2. Click the Insert tab, then click Pictures.
  3. Select the placeholder image you want to use, then click Insert. For information on how to prevent the image from skewing, refer to this community article.
  4. In theDocGen Package tab, select a DocGen Package.
  5. Click Field Tagger, and then select Word/PowerPoint Tags.

Note: For Microsoft Excel, selecting Excel/PDF Tags as the Document Type will not work, as the Field Tagger does not include the angle brackets. To tag images in placeholders in Microsoft Excel, angle brackets are required; therefore select Word/Powerpoint Tags.

  1. Select the Salesforce object relationship that contains the field that needs to be copied to the document. This is the field you added in Add Rich Text fields to objects.
  2. Select the object that you use and then expand it.
  3. Copy the field tag of the rich text field you created earlier.
  4. Click the placeholder image.
  5. On the Picture Format tab, in the Selection section, click Selection Pane.
  6. In the Selection pane, double-click the reference to the placeholder image, paste the tag from the field tagger, then edit the tag to include "__image" inside the angle brackets.

    Example: <<Account_Nintex__image>>

  7. Save the template and then add the updated template to the DocGen Package. For more information on how to add templates to DocGen Packages, see Manage templates in DocGen Packages.

Set up Microsoft templates to include hyperlinks to images

You can add hyperlinks to images in Microsoft Word templates using the picture content control. In this control, enter the field tag for the hyperlink, and then format the tag as a hyperlink. You can then add the template to a DocGen Package and use it to generate documents that include images with hyperlinks.

Before you begin:

  • Microsoft Word on a PC only.

  • Enable the Developer tab in Microsoft Word. For more information, see Show the Developer tab.

To set up your Microsoft Word template with hyperlinks to images:

  1. In Microsoft Word, place the cursor where you want the picture to be displayed in your template.
  2. Click the Developer tab, and in the Controls section, click the Picture Content Control picture icon to add an image.
  3. Select the image, and on the Developer tab, click Properties.

  4. In the Content Control Properties box, enter the tag for the hyperlink from the Nintex DocGen Field Tagger into the Tag field.

    For example, the <<Account_Website>> tag from the Field Tagger.

  5. Edit the tag to include "__hyperlink" inside the closing angle brackets.

    For example, <<Account_Website__hyperlink>>

  6. Click OK.

  7. Save and add this template to your DocGen Package.

You can then generate documents that includes the image and an attached hyperlink.

Generate documents with images from the record

You can generate documents from a DocGen Package that contains templates with tags for images with Rich Text fields.

  1. Navigate to the App Launcher by selecting the app launcher in the upper left corner, and select Nintex DocGen.
  2. Select the DocGen Packages tab.
  3. Select a DocGen Package.
  4. Select a record that contains a Rich Text field in the template.
  5. Select a contact if necessary.
  6. Select Test Download.
  7. Click Run DocGen Package.
  8. Click the output file to download. The placeholder image will be replaced with the image from the Rich Text field.