Documents CorePack add-on provides functionality of transforming data/information from Dynamics 365 into professionally looking documents. The Documents CorePack Client provides an easy way of generating templates using standard Microsoft Word layouts combined with Documents CorePack Template Designer.
When designing a template, displaying images provides good visual context to a document and displaying different images base on conditionals are more informative than text. The standard way Documents CorePack achieves conditional statement is by using if statement placeholders
Dear {if”<<salutation>>”=”Mr.” “Mister” “Misses”} <<lastname>>
But since an if statement placeholder only works with text and not images, this way would not achieve conditional base images. After investigating other functionalities that Documents CorePack provides, I came across Condition field which can be used to display conditional images.
To demonstrate, in Dynamics 365 I have a Satisfaction field against an Account which is an option set field containing the following satisfaction types base on Facebooks emojis:
In the Document Template the Satisfaction field will be represented by one of the following Facebooks emojis images:
Here are the steps required to implement conditional images against the Satisfaction field:
1. Select Insert Computed Item > Insert Condition field
2. Create an IsLike condition field, where in the designer section you select condition where Satisfaction equals Like and click on OK
3. An IsLike condition field will be created, Insert Picture into the condition field
4. Adjust the size of the image
5. Repeat steps 1-4 for the other Satisfaction conditions
6. Generate Document
Inserting images into a Condition field offers a way of achieving conditional base images which provides good visual context.