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.
Add filtered merge fields from related objects to your template
- Choose a template you would like to edit
- Choose a related object from the Field or Related Object dropdown list
- Click on the filter and sort button on the right of the dropdown
- Choose a field to filter by for that related object
- Choose the operator to filter by
- The options in this picklist will be based on the field you chose to filter by
- In the dropdown below the filter and sort section, choose the field from that related object you would like to display
- 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 | 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 | 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 | 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 | Phone | Primary | |
---|---|---|---|
Geoff Minor | geoff@uag.com | (212) 328-9677 | true |