Add filters to related lists

Related objects can be filtered to retrieve a more specific set of data when using the template builder in the Drive Connect app. Using this powerful tool, you’ll be able to get the exact data you need from related objects.

  1. Choose a template you would like to edit
  2. Choose a related object from the Field or Related Object dropdown list
  3. Click on the filter and sort button on the right of the dropdown
  4. Choose a field to filter by for that related object
  5. Choose the operator to filter by
    • The options in this picklist will be based on the field you chose to filter by
  6. In the dropdown below the filter and sort section, choose the field from that related object you would like to display
  7. Copy the merge field and add it to your Google Doc

Note: You can add multiple filters to a field by clicking the add criteria button underneath the first filter by section. You must choose a logical operator (AND / OR clause) for the filters in this case.

Table example: Displaying Contacts from an Opportunity using the primary field as a filter

All Contacts on an Opportunity (OpportunityContactRole)

Merge Table

Contact Name Email Phone Primary
{{!Opportunity.r.OpportunityContactRoles.Contact.Name}} {{!Opportunity.r.OpportunityContactRoles.Contact.Email}} {{!Opportunity.r.OpportunityContactRoles.Contact.Phone}} {{!Opportunity.r.OpportunityContactRoles.IsPrimary::true::false}}

Result

Contact Name Email Phone Primary
Geoff Minor geoff@uag.com (212) 328-9677 true
Howard Jones howard@uag.com (212) 328-9675 false

All Contacts on an Opportunity (OpportunityContactRole) using a filter on the primary field

Merge Table

Contact Name Email Phone Primary
{{!Opportunity.r.OpportunityContactRoles::WHERE(TRUE(OpportunityContactRole.IsPrimary)).Contact.Name}} {{!Opportunity.r.OpportunityContactRoles::WHERE(TRUE(OpportunityContactRole.IsPrimary)).Contact.Email}} {{!Opportunity.r.OpportunityContactRoles::WHERE(TRUE(OpportunityContactRole.IsPrimary)).Contact.Phone}} {{!Opportunity.r.OpportunityContactRoles::WHERE(TRUE(OpportunityContactRole.IsPrimary)).IsPrimary::true::false}}

Result

Contact Name Email Phone Primary
Geoff Minor geoff@uag.com (212) 328-9677 true