mscrm-addons.com logomscrm-addons.com logo
  • Release History
  • Knowledge Base
  • Documentation
  • Contact Support
  • Release History
  • Knowledge Base
  • Documentation
  • Contact Support
home/Knowledge Base/DocumentsCorePack(DCP)/Advanced filtering with DocumentsCorePack: Dynamic Filters and Column Compare

Advanced filtering with DocumentsCorePack: Dynamic Filters and Column Compare

3768 views 2 Updated on February 29, 2024

When including filters into your templates, there are two advanced features that can be included to increase the reporting capabilities of DocumentsCorePack templates: dynamic filters and column compare.  This article serves to explain both features by providing example use cases. 

Note: To use and understand these features, it is recommended to have experience with basic template creation and: 

  • Creation of relationships 
  • Relationship filters 
  • User prompts 

Prerequisites: 

  • DocumentsCorePack Server version 2020.105 or higher (see version and update info here) 
  • DocumentsCorePack Template Designer version 10.25 or higher (download here) 

Dynamic Filters 

Dynamic filters allow tables to be filtered based on a user-defined value that is passed in during the document generation process. 

In the following example, we will create a template that contains one table that will be filtered by last name, and another table that will be filtered by a given date. 

Example: 

In this template, we have already created two tables, as shown below.  The first table will only contain contacts with a last name that we will specify in one of our prompt fields.  The second table will only contain contacts born after a specified date. 

Our two tables
Figure 1: Our two tables
Both of these tables will be filtered based on user prompts.  To create a user prompt field, navigate to the Advanced Template Settings of your template and select ❶ Prompts.  Then, click the ❷ Add Prompt button. 
Adding a prompt field
Figure 2: Adding a prompt field

We will create two user prompts for our template, one for our last name filter, and one for our date filter.  They will look like the following: 

Our last name prompt field
Figure 3: Our last name prompt field
Our date prompt field
Figure 4: Our date prompt field

With our user prompts created, we can now create the filters. 

To apply a dynamic filter to our first table, we will navigate to the Relationship Designer through the Template Designer.  From there, click the ❶ Add button under Filter and then the ❷ Add button under Conditions.  This will open up the ❸ Conditions window, where we will create the filter we need. 
Accessing the condition designer for our filter
Figure 5: Accessing the condition designer for our filter
For this filter, we will set ❶ Attribute to Last Name and ❷ Operator to equals.  The ❸ Dynamic Filter will be set to the user prompt we created earlier. 
Configuring our filter for our last name prompt
Figure 6: Configuring our filter for our last name prompt

Our other filter for our second table will be configured similarly, but for our “bornafter” user prompt instead.  Note that the operator must be set to on or after in this case. 

Configuring our filter for our date  prompt
Figure 7: Configuring our filter for our date prompt

After both filters have been created and applied, save the template and generate a document.  During the document generation process, an additional window will appear, prompting for a user-defined value. 

The prompts shown in the DocumentsCorePack Dialog during the document generation process
Figure 8: The prompts shown in the DocumentsCorePack Dialog during the document generation process

Once the values have been entered, proceed through the rest of the document generation process.  The resulting document should appear like the following: 

Our tables, now filtered based on our prompts
Figure 9: Our tables, now filtered based on our prompts

Column Compare 

Column compare filters a given relationship based on the compared result between two fields within the same record.   

In the following example, our goal is to create an account template that lists all related contacts in two separate tables: one which displays all contacts whose primary and billing address are the same, and another which displays all contacts whose primary and billing address are different. 

Example: 

We will begin by creating two tables based on the Contact entity.  The first table (“Matching Addresses”) will only contain the full name and primary address of the contact.  The second table (“Separate Addresses”) will contain the contact’s full name, and both the primary and billing address. 

Our two tables, one showing only one address field, and another showing a primary and billing address field
Figure 10: Our two tables, one showing only one address field, and another showing a primary and billing address field
To apply a column compare filter to our first table, we will navigate to the Relationship Designer through the Template Designer.  From there, click the ❶ Add button under Filter and then the ❷ Add button under Conditions.  This will open up the ❸ Conditions window, where we will create the filter we need. 
Accessing the condition window for our filter
Figure 11: Accessing the condition window for our filter
To configure our filter, we will set ❶ Attribute to Primary Address and ❷ Operator to equals.  Then, we will ❸ select Column Compare and set its field to Billing Address.  This will ensure that the only contacts that will be displayed in this table will be contacts that have the same address in both fields. 
Configuring our column compare filter for our first table
Figure 12: Configuring our column compare filter for our first table

For our second table, that configuration is similar, with the Operator being changes to not equals instead.  This table will then only display contacts with different addresses in their address fields. 

Configuring our column compare filter for our second table
Figure 13: Configuring our column compare filter for our second table

When a document is generated based on this template, the filter will be applied to both tables.  The following figure shows an example result. 

Our resulting tables
Figure 14: Our resulting tables

That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com. 

Was this helpful?

2 Yes  1 No
Related Articles
  • Deploying DocumentsCorePack: Setup, Automation, and Real Business Impact in Dynamics365
  • Introducing the DocumentsCorePack Template Designer Office Add-In (Beta)
  • 3 Ways DocumentsCorePack Transforms Proposal, Quote, and Contract Creation
  • DeepSign for DocumentsCorePack 
  • Generate and send a document for e-signing using DeepSign
  • How to prepare a document for DeepSign
Latest Articles
  • What Happens After You Deploy AttachmentExtractor: Storage & Cost Savings in Dynamics 365
  • Deploying DocumentsCorePack: Setup, Automation, and Real Business Impact in Dynamics365
  • Introducing the DocumentsCorePack Template Designer Office Add-In (Beta)
  • How to Eliminate Excess Storage Costs in Microsoft Dynamics 365 Without Losing Access to Emails and Attachments
  • 3 Ways DocumentsCorePack Transforms Proposal, Quote, and Contract Creation
Popular Articles
  • DocumentsCorePack Template Designer – Getting Started
  • Step-by-Step: How to configure a One-Click-Action
  • Application Access for Dynamics 365
  • How to find your environment’s unique name in Microsoft Dynamics 365
  • How licenses are counted
Top Rated Articles
  • “Undefined”-labels in Chrome and Edge 114 and higher
  • Important information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack Connector for PowerApps & Microsoft Flow
  • How to insert Condition Fields in DocumentsCorePack Templates designer
  • How licenses are counted
Categories
  • *News and General Infos* 64
  • Webinars 45
  • Template Designer(DCP 196
  • DocumentsCorePack(DCP 258
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 75
  • PowerSearch (PS 50
  • ActivityTools (AT 61
  • SmartBar (SB 54
  • GroupCalendar (GC 47
Our Vision

“We see it as our purpose to provide products that simplify and speed up our customers’ Microsoft Dynamics 365 experience.”

Knowledgebase
LogIn
mscrm-addons.com
  • Products
  • Online Shop
  • Downloads
  • My Account
About Us
  • About Us
  • Case Studies
  • Newsletter
  • Partner Program
  • Contact
Support
  • Support
  • Terms & Conditions
  • Documentation
  • Webinars
  • Legal Documents
  • Impressum
  • © 2025 www.mscrm-addons.com. All Rights Reserved.