Sort related lists and tables on your Drive Connect templates

Related lists and tables can be sorted to a specific order when using the template builder in the Drive Connect app.  Use this tool to display the most important information first in your lists and data tables in a logical manner.

Note: Merge fields in a data table must all have the same sorting criteria in order for the document to generate

Sort related lists on your template 

  1. Choose the template you would like to edit
  2. Choose a related object from the Field or Related Object dropdown list
  3. Choose the field from that related object you would like to display
  4. Click on the filter and sort button
  5. Click on the Sort By drop down and choose the determining field for sorting
  • Choose whether the field should be sorted ascending or descending
  1. Copy the merge field and add it to your Google Doc

Table example:  Displaying products from an Opportunity using the sort filter on name ascending

All products from an Opportunity (no filter)

Merge Table

PRODUCT

SALES PRICE

QUANTITY

TOTAL PRICE

{{!Opportunity.r.OpportunityContactRoles.Contact.Name}}

{{!Opportunity.r.OpportunityContactRoles.Contact.Email}}

{{!Opportunity.r.OpportunityContactRoles.Contact.Phone}}

{{!Opportunity.r.OpportunityContactRoles.IsPrimary::true::false}}

Result

PRODUCT

SALES PRICE

QUANTITY

TOTAL PRICE

CRM Deployment

$10,000

1.00

$10,000

Maintenance

$7,500

1.00

$7,500

SEO

$8,000

1.00

$8,000

Architecture

$5,600

1.00

$5,600

Website Deployment

$12,000

1.00

$12,000

All Products on an Opportunity using sort on the product name ascending

Merge Table

PRODUCT

SALES PRICE

QUANTITY

TOTAL PRICE

{{!Opportunity.r.OpportunityLineItems::ORDER_BY(Name,ASC).Product2.Name}}

{{!Opportunity.r.OpportunityLineItems::ORDER_BY(Name,ASC).UnitPrice::Symbol}}

{{!Opportunity.r.OpportunityLineItems::ORDER_BY(Name,ASC).Quantity}}

{{!Opportunity.r.OpportunityLineItems::ORDER_BY(Name,ASC).TotalPrice::Symbol}}

Result

PRODUCT

SALES PRICE

QUANTITY

TOTAL PRICE

Architecture

$5,600

1.00

$5,600

CRM Deployment

$10,000

1.00

$10,000

Maintenance

$7,500

1.00

$7,500

SEO

$8,000

1.00

$8,000

Website Deployment

$12,000

1.00

$12,000