Mail Merge Syntax

Different field types require different code syntax when you build a Mail Merge export template.

For example, you can include cross-referenced applications and sub-forms in the Mail Merge code to pull data from related records if they are encased by a TableStart and TableEnd, while a numeric field does not require any special syntax.

The attributes applied to a field may also affect the merge code syntax.

For example, a text field does not require any special syntax, but a text area that allows for text formatting requires the code syntax to support HTML.

Note: The aliases for cross-referenced applications or sub-forms need to come from the field in the source application and not from the alias of the cross-referenced application itself.

Syntax Formatting

You can choose to display either the Mail Merge code itself or the code output. Ensure you update both sides of the code using F9.

Press [Alt]+[F9] to display the code syntax view and the code output view.

The following table displays merge code syntax and code output for each field type. Field Attribute is left blank where the display control does not affect the code syntax.

Note: The date formats showcased (MMMM, d, yyyy and M/d/yyyy) are interchangeable across date fields. You are not required to only show drop-down dates in the format given in these examples.

Field Type

Field Attribute (Display Control)

Code Syntax

Code Output (other side viewable by pressing [Alt]+[F9])

Attachment

 

{ MERGEFIELD TableStart:Attachment \* MERGEFORMAT }{ MERGEFIELD Id \* MERGEFORMAT },{ MERGEFIELD Name \* MERGEFORMAT },{ MERGEFIELD Description \* MERGEFORMAT }{ MERGEFIELD TableEnd:Attachment \* MERGEFORMAT }

<<TableStart: Attachment_Grid >><<Value>>, <<Value>> , <<Value>> <<TableEnd: Attachment_Grid>>

Attachment

Attachment ID (List)

{ MERGEFIELD List:Attachment.Id \* MERGEFORMAT }

<<List:Attachment_Grid.Id>>

Attachment

Attachment Name (Bulleted)

{ MERGEFIELD List:Attachment.Name \!list Bullet \* MERGEFORMAT }

<<List:Attachment_Grid.Name>>

Attachment

Attachment Description (Numbered)

{ MERGEFIELD List:Attachment.Description \!list Numbered \* MERGEFORMAT }

<<List:Attachment_Grid.Description>>

Attachment

Attachment Length (Numbered)

{ MERGEFIELD List:Attachment.Length \!list Numbered \* MERGEFORMAT }

<<List:Attachment_Grid.Description>>

Attachment

Attachment SystemDate (Numbered)

{ MERGEFIELD List:Attachment.SystemDate \!list Numbered \* MERGEFORMAT }

<<List:Attachment_Grid.Description>>

Attachment

Attachment Downloads (Numbered)

{ MERGEFIELD List:Attachment.Downloads \!list Numbered \* MERGEFORMAT }

<<List:Attachment_Grid.Description>>

Attachment Data

 

{ MERGEFIELD Attachment.Data }

<<List:Attachment_Grid.Description>>

Cross-Reference, Related Record, or Sub-Form

 

{ MERGEFIELD TableStart:Cross_Reference_Field_Alias }{ MERGEFIELD Field_Alias }{ MERGEFIELD TableEnd:Cross_Reference_Field_Alias }

<<TableStart:Cross_Reference_Field_Alias>><<Field_Alias>><<TableEnd:Cross_Reference_Field_Alias>>

Date

Text Box - Date Only

{ MERGEFIELD Date_Field_Alias \@ “MMMM d, yyyy” \* MERGEFORMAT }

<<Date_Field_Alias>>

Date

Text Box - Date and Time

{ MERGEFIELD Date_Field_Alias \@ “MMMM d, yyyy h:mm:ss am/pm” \* MERGEFORMAT }

<<Date_Field_Alias>>

Date

Dropdown - Date Only

{ MERGEFIELD Date_Field_Alias \@ “M/d/yyyy” \* MERGEFORMAT }

<<Date_Field_Alias>>

External Link

 

{ MERGEFIELD List:External_Link_Alias.Name \* MERGEFORMAT }

<<List:External_Link_Alias.Name>>

First Published

Date

{ MERGEFIELD First_Published_Date_Alias.Date }

<<First_Published_Date_Alias.Date>>

First Published

User Name

{ MERGEFIELD First_Published_Date_Alias.UserName }

<<First_Published.UserName>>

First Published

Display Name

{ MERGEFIELD First_Published_Date_Alias.UserName }

<<First_Published.DisplayName>>

IP Address

 

{ MERGEFIELD IP_Address_Field_Alias }

<<IP_Address_Field_Alias>>

Last Updated

Date

{ MERGEFIELD Last_Updated _Alias.Date }

<<Last_Updated_Alias.Date>>

Last Updated

User Name

{ MERGEFIELD Last_Updated _Alias.UserName }

<<Last_Updated_Alias.UserName>>

Last Updated

Display Name

{ MERGEFIELD Last_Updated _Alias.DisplayName }

<<Last_Updated_Alias.DisplayName>>

Numeric

 

{ MERGEFIELD Numeric_Field_Alias }

<<Numeric_Field_Alias>>

Record Status

 

{ MERGEFIELD Record_Status }

<<Record_Status>>

Record Permissions or Users/Groups

 

{ MERGEFIELD List:Record_Permission_Alias.DisplayName }

<<List:Record_Permission_Alias.DisplayName >

Text

Field

{ MERGEFIELD Text_Field_Alias }

<<Text_Field_Alias>>

Text

Area

{ MERGEFIELD Text_Area_Alias \!format “html:Text_Field_Alias” \* MERGEFORMAT }

<<Text_Area_Alias>>

Tracking ID

 

{ MERGEFIELD Tracking_ID_Alias }

<<Tracking_ID_Alias>>

Values List

 

{ MERGEFIELD List:Values_List_Alias.Value \* MERGEFORMAT }

<<List:Values_List_Alias.Value>>

Voting

 

{ MERGEFIELD Voting_Alias }

<<Voting_Alias>>