Dynamic Images in Templates
To use dynamic images Any image related to a record. and place them into your 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 field to hold your images on 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 CERT: 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.
Complete the four steps below to add dynamic images to your templates:
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 in Salesforce:
- From Setup, perform one of the following actions:
- For standard objects, type the name of the object in the Quick Find box, then click Fields & Relationships.
- For example, if you wanted to add a Rich Text field to the Account object, you would click Fields under Account.
- For custom objects, type "Objects" in the Quick Find box, then click Object Manager.
- For example, if you wanted to work with a custom object named Cases, you would select Cases.
- In Fields & Relationships, click New.
- Under Data Type, select Text Area (Rich), then click Next.
- Type in the required fields and/or any optional fields.
- Click Next.
- Establish the field-level security, then click Next.
- Select one or more page layout options to add to the Rich Text field.
- 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 an online image using a URL.
-
Open the object that you added the Rich Text field to.
Example: From Accounts, click Acme Co.
- In the Details tab, under Additional Information, click the pencil icon to edit the Rich Text field.
- To insert an image, perform one of the following actions:
-
If you want to upload an image from your computer:
- Click the image icon .
- 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:
-
Click the link icon .
-
Enter the URL for the image.
-
Click Save.
-
Add images in Snippets
You can add an image to a snippet to make it reusable across multiple DocGen Packages. For more information on creating and using snippets, see Snippets and Snippet Groups.
Add images to output with button parameters
Note: These instructions apply to the Salesforce Classic experience.
You can use a button parameter to add images from Salesforce records. Add an image to Salesforce and then create a custom button that references that image. When the user generates documents with the button, the app merges the image into output documents.
Add an image to the Documents object and get the Salesforce Id for the image.
To add an image to the Documents object:
-
From Documents, click New.
-
Under Enter details, add the required name fields (Document Name and Document Unique Name) , select a shared folder in Folder, and fill in any optional fields.
-
Under Select the File, take one of the following actions:
-
Click Enter the path of the file or click browse to find the file and then click Choose File to select a file from your computer.
-
Click Create a reference link to the file and in Path/URL to reference, type a URL.
-
-
Click Save.
Salesforce saves the image to Documents and the detail page appears with the Salesforce id for the image in the URL. On the browser, note the Salesforce Id for the image in the URL. In the next procedure, you will add this Id to the custom button.
Configure a button so that the image is assigned to a parameter when a user clicks the button. When you configure the template in the next sections, you will use this parameter to create the tag for the template.
To configure a button to add an image parameter:
-
In Nintex DocGen, click DocGen Admin.
-
Under Classic Experience Buttons, click Button Wizard.
-
Under DocGen Package Starting Object, take one of the following actions:
-
If the object on which you added the text field is listed, select it. For example, select Accounts.
-
If the object on which you added the text filed is not listed, select Other and then select the object on which you added the text field.
-
-
(Optional) In Button Name, type a name.
-
Click Create Button.
The New Button or Link settings page is displayed. -
In the Custom Button or Link editor, type all of the following
-
an ampersand (&)
-
the word "image"
-
any unique string ("_logo")
-
an equal sign (=)
-
the case sensitive Salesforce Id of the image ("01536000002gEAK" )
-
the file extension of the image (".jpg")
For example, type &image_logo=01536000002gEAK.jpg
The keyword image and the string make up the parameter. For example, image_logo is the parameter. This is the reference for the tag that will go into the template in the next procedure. -
-
(Optional) Click Check Syntax.
-
Click Save.
You are prompted about adding the button to page layouts. -
On the page layout for your object, click Edit to add the button to a page layout.
-
In the page layout editor, click Buttons and then drag the button under Custom buttons.
-
Click Save.
Configure Microsoft templates
Add images to Microsoft Word, Microsoft Excel, and Microsoft PowerPoint templates. A generated document will take the placeholder and replace it with the image.
Configure Microsoft Word templates
- In Microsoft Word, place the cursor where you want the image to appear from the Rich Text field.
- Click the Insert tab, the click Pictures.
- 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.
- From the DocGen Package, click the Field Tagger button.
- In Document Type, select Word/PowerPoint.
- Select the Salesforce object relationship that contains the field that needs to be copied to the document. This is going to be the field you added in Add Rich Text fields to objects.
- Copy the tag from the Field Tags section under Tag.
- In Microsoft Word, double-click the placeholder image.
- Click the Select drop-down from the Editing section, and then click Selection Pane.
- In the Selection window, 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>>
- Save the template and then add the updated template to the DocGen Package. For more information on how add templates to DocGen Packages, see Manage templates in DocGen Packages.
You can add hyperlinks to images in Microsoft Word templates using the picture content control. In this control, you 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.
Requirements
-
Microsoft Word on a PC only.
-
Use a placeholder dynamic image (not just the tag) to merge the image. Apply the hyperlink to the placeholder image, and during document generation, the output will include the merged image with the hyperlink. For more information, see Set up your Microsoft Word templates to include dynamic images.
-
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:
- In Microsoft Word, place the cursor where you want the picture to be displayed in your template.
- Click the Developer tab and in the Controls section, click the Picture Content Control picture icon to add an image.
-
Select the image and on the Developer tab, click Properties.
-
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.
-
Edit the tag to include two consecutive underscores followed by hyperlink (__hyperlink) inside the closing angle brackets.
For example, <<Account_Website__hyperlink>>
-
Click OK.
-
Save and add this template to your DocGen Package
You can then generate documents with the image and attached hyperlink.
Configure Microsoft Excel templates
- In Microsoft Excel, place the cursor where you want the image to appear from the Rich Text field.
- Click the Insert tab, then click Pictures.
- 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.
- From the DocGen Package, click the Field Tagger button.
- In Document Type, select Word/PowerPoint. (Normally, you would select Excel/PDF as the Document Type, but to tag images in placeholders in Microsoft Excel, you must use angel bracket tags.)
- Select the Salesforce object relationship that contains the field that needs to be copied to the document. This is going to be the field you added in Add Rich Text fields to objects.
- Copy the tag from the Field Tags section under Tag in the Field Tagger.
- In Microsoft Excel, double-click the placeholder image.
- Click Selection Pane from the Arrange section.
- In the Selection window, 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>>
- Save the template and then add the updated template to the DocGen Package. For more information on how add templates to DocGen Packages, see Manage templates in DocGen Packages.
Configure Microsoft PowerPoint templates
- In Microsoft PowerPoint, place the cursor where you want the image to appear from the Rich Text field.
- Click the Insert tab, then click Pictures.
- 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.
- In Document Type, select Word/PowerPoint.
- Select the Salesforce object relationship that contains the field that needs to be copied to the document. This is going to be the field you added in Add Rich Text fields to objects.
- Copy the tag from the Field Tags section under Tag in the Field Tagger.
- In Microsoft PowerPoint, double-click the placeholder image.
- Click Selection Pane from the Arrange section.
- In the Selection window, 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>>
- Save the template and then add the updated template to the DocGen Package. For more information on how add templates to DocGen Packages, see Manage templates in DocGen Packages.
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.
- Navigate to the App Launcher by selecting the in the upper left corner, select Nintex DocGen.
- Select the DocGen Packages tab.
- Select the DocGen Package you want to generate a document with images.
- Select the record that contains a Rich Text field in the template.
- Select a contact if necessary.
- Select Test Download.
- Click Run DocGen Package.
- Download the output file. The placeholder image will be replaced with the image from the Rich Text field.