Drive Connect Document Generation Formatting Guide
With Drive Connect users can generate templates that take data from Salesforce records and populates them into their documents. There are many ways in which users can create these templates so below are provided examples of supported formats for these templates.
- Basic Object Merge Fields
- Look-Up Merge Fields
- Related List Merge Fields
- Filter & Sort Merge Fields
- Conditional Merge Fields
- Advanced Formatting
Basic Object Merge Fields
Basic object merge fields will only return the data from the record the document generation is triggered on. For example: {{!Account.Name}} or {{!Account.Description}}. For these merge field types you can freely add them anywhere in the document and your data will return if there is data on that field. If there isn’t then a blank value will print out. Only one value at most will return per merge field. Below is an example of these merge field types in the supported formatting:
{{!Account.Name}}
{{!Account.Name}}{{!Account.Description}}
Beginning{{!Account.Name}}-{{!Account.Description}}End
{{!Account.Name}} {{!Account.Description}}
{{!Account.Name}}↵
{{!Account.Description}}{{!Account.Name}}¶
{{!Account.Description}}({{!Account.Name}}-{{!Account.Description}})
Name Description {{!Account.Name}} {{!Account.Description}}
Name Org Description {{!Account.Name}} Appiphony {{!Account.Description}}
- {{!Account.Name}}
- {{!Account.Description}}
Look-Up Merge Fields
Look-up merge fields will return data from another object record other than the one the merge document is triggered on. This would be a field that has a look-up relationship field on the record. For example: {{!Opportunity.Account.Name}} or {{!Opportunity.Account.Description}}. For these merge field types you can freely add them anywhere in the document and your data will return if there is data on that field or if there isn’t a blank value will print out. Only one value at most will return per merge field. Below is an example of these merge field types in the supported formatting:
{{!Opportunity.Account.Name}}
{{!Opportunity.Account.Name}}{{!Opportunity.Account.Description}}
Beginning{{!Opportunity.Account.Name}}-{{!Opportunity.Account.Description}}End
{{!Opportunity.Account.Name}} {{!Opportunity.Account.Description}}
{{!Opportunity.Account.Name}}↵
{{!Opportunity.Account.Description}}{{!Opportunity.Account.Name}}¶
{{!Opportunity.Account.Description}}({{!Opportunity.Account.Name}}-{{!Opportunity.Account.Description}})
Name Description {{!Opportunity.Account.Name}} {{!Opportunity.Account.Description}}
Name Org Description {{!Opportunity.Account.Name}} Appiphony {{!Opportunity.Account.Description}}
- {{!Opportunity.Account.Name}}
- {{!Opportunity.Account.Description}}
Related List Merge Fields
Basic object merge fields will only return the data from the record the document generation is triggered on. For example: {{!Account.Name}} or {{!Account.Description}}. For these merge field types you can freely add them anywhere in the document and your data will return if there is data on that field, the one exception being tables where related lists can only be stacked by cells horizontally. If there isn’t then a blank value will print out. For these merge fields multiple rows of data will return depending on how many records are associated with the related list. Below is an example of these merge field types in the supported formatting:
{{!Account.r.Opportunities.Name}}
{{!Account.r.Opportunities.Name}}{{!Account.r.Opportunities.Description}}
Beginning{{!Account.r.Opportunities.Name}}-{{!Account.r.Opportunities.Description}}End
{{!Account.r.Opportunities.Name}} {{!Account.r.Opportunities.Description}}
{{!Account.r.Opportunities.Name}}↵
{{!Account.r.Opportunities.Description}}{{!Account.r.Opportunities.Name}}¶
{{!Account.r.Opportunities.Description}}({{!Account.r.Opportunities.Name}}-{{!Account.r.Opportunities.Description}})
Name Description {{!Account.r.Opportunities.Name}} {{!Account.r.Opportunities.Description}}
Name Org Description {{!Account.r.Opportunities.Name}} Appiphony {{!Account.r.Opportunities.Description}}
- {{!Account.r.Opportunities.Name}}
- {{!Account.r.Opportunities.r.OpportunityLineItems.Name}}
Filter & Sort Merge Fields
Filter and Sort merge fields are additional options available only when related list merge fields are used, therefore they will have the same formatting limitations as related lists. For example: {{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}}. Below is an example of these merge field types in the supported formatting:
{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}}
{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}}{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Description}}
Beginning{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}}-{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Description}}End
{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}} {{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Description}}
{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}}↵
{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Description}}{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}}¶
{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Description}}({{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}}-{{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Description}})
Name Description {{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}} {{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Description}}
Name Org Description {{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}} Appiphony {{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Description}}
- {{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Name}}
- {{!Account.r.Opportunities::WHERE(EQUALS(Opportunity.StageName,'Needs Analysis'))::ORDER_BY(Name,ASC).Description}}
Conditional Merge Fields
Conditional merge fields are additional options available through the Type: Functions under the Function: Conditional Logic in the merge field generator. For example: {{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}}. Any content wrapped around the conditional merge field will return if the condition is met, but if the condition is not met a blank value will return. Below is an example of these merge field types in the supported formatting:
{{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}}
{{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}}{{!IF(NOT_NULL(Account.Description))}}The description is not null.{{!/IF}}
Beginning{{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}}-{{!IF(NOT_NULL(Account.Description))}}The description is not null.{{!/IF}}End
{{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}} {{!IF(NOT_NULL(Account.Description))}}The description is not null.{{!/IF}}
{{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}}↵
{{!IF(NOT_NULL(Account.Description))}}The description is not null.{{!/IF}}{{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}}¶
{{!IF(NOT_NULL(Account.Description))}}The description is not null.{{!/IF}}({{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}}-{{!IF(NOT_NULL(Account.Description))}}The description is not null.{{!/IF}})
Name Description {{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}} {{!IF(NOT_NULL(Account.Description))}}The description is not null.{{!/IF}}
Name Org Description {{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}} Appiphony {{!IF(NOT_NULL(Account.Description))}}The description is not null.{{!/IF}}
- {{!IF(CONTAINS(Account.Name,'A'))}}The condition is met.{{!/IF}}
- {{!IF(NOT_NULL(Account.Description))}}The description is not null.{{!/IF}}