Select Page

Introduction

Filter Block is a powerful feature in docu2.me that allows you to conditionally display information related to a record, such as contracts or quotes. This example demonstrates how to use Filter Block with an Account record.

Objective

Create a document that displays Account information using Filter Block, and observe how changes in the record affect the document’s content.

Step-by-Step Guide

1. Prepare the Account Record

Select an Account record to use as an example. In this case, we’re using “United Oil & Gas Corp.

Account record page for United Oil & Gas Corp showing basic information fields
Account record example showing basic information

2. Create a New docu2.me Document

  1. In “docu2.me Files”, click “New” to create a new document.
  2. Title the document “Filter Block”.

3. Add Dynamic Fields for Account Information

Create tables for different categories of information and add dynamic fields:

Filter Block Example:

Account Info

  • Account Name: {!$Record.Name}
  • Account Number: {!$Record.AccountNumber}
  • Type: {!$Record.Type}
Animation showing how to add dynamic fields for account information
Adding dynamic fields for account information

Customer Priority

  • SLA: {!$Record.SLA__c}
  • SLA Serial Number: {!$Record.SLASerialNumber__c}

Rating

  • Industry: {!$Record.Industry}
  • Account Owner: {!$Record.Owner.Name}

Client Type

  • Website: {!$Record.Website}
  • Phone: {!$Record.Phone}
Animation demonstrating how to add multiple tables with different field categories
Creating tables with different categories of account information

4. Implement Filter Blocks

Apply Filter Blocks to specific tables:

Animation showing the process of applying filter blocks to tables
Inserting and configuring filter blocks on tables

Customer Priority Table

  • Right-click on the table and select “Filter Block”

Configuration:

  • Field: Customer Priority
  • Condition: CustomerPriority__c == (‘High’)

Rating Table

  • Filter: Rating == (‘Hot’)

Client Type Table

  • Filter: Type == (‘Customer – Direct’)
Screenshot showing the filter blocks applied to different sections of the document
Document with filter blocks applied to different tables

5. Save and Preview the Document

  • Save the document and use the print function to preview it as a PDF.
  • Observing Filter Block Behavior
PDF preview showing all sections visible when filter conditions are met
PDF preview with all filter conditions met

Initial State

  • In the initial state, all information should be visible as the conditions match the record data.

Demonstrating Dynamic Behavior

Modify the Account record:

  • Change “Customer Priority” from “High” to “Low”
  • Change “Rating” from “Hot” to “Cold”
  • Regenerate the PDF document
Animation showing how modifying account record fields affects the filter conditions
Modifying account record fields to test filter conditions

Result

  • After modifying the record:
  • The “Customer Priority” and “Rating” tables will disappear from the document.
  • This occurs because the Filter Block conditions are no longer true for these sections.
PDF preview showing how sections are hidden when filter conditions are not met
PDF with sections hidden after filter conditions changed

Key Takeaways

  • Filter Blocks allow conditional display of information based on field values.
  • When conditions are true, the data is shown; when false, the entire section is hidden.
  • This feature is useful for creating dynamic documents that adapt to record changes.
  • You can use Filter Blocks to show or hide specific fields, text sections, or entire tables based on record data.

Best Practices

  • Carefully consider which fields to use in Filter Block conditions.
  • Test your document with various record states to ensure it behaves as expected.
  • Use clear and specific conditions to avoid unexpected results.
  • Consider combining Filter Blocks with other docu2.me features for more complex document logic.