New to Telerik Document ProcessingStart a free 30-day trial

MergeField Field

Updated on Jun 16, 2026

MergeField is a Field element that contains a reference to a data field by its name. When you mail merge a template document with the values from a data source, the data field information replaces the merge field. For more information on the mail merge feature, see the Mail Merge article.

Field Syntax

The following table shows the syntax of a Merge field:

Syntax
{ MERGEFIELD FieldName [Switches]}

Figure 1 shows the syntax of a Merge field code.

Figure 1: Merge Field Code Syntax

Merge field code syntax showing the MERGEFIELD keyword and field name

"FieldName"

The name of a data field listed in the header record of the selected data source. The field name must exactly match the field name in the header record.

Switches

Switches allow the code fragment to specify formatting for the result of the field. More information is available in the Syntax and Switches section of the Fields article.

The possible switches for a Merge field are:

SwitchDescription
@ "Date-Time Picture"Specifies a date format different from the default format.
\* Format SwitchSpecifies the appearance of the number if different from the default format.
\bSpecifies text that is inserted before the Merge Field if the field is not blank.
\fSpecifies text that is inserted after the Merge Field if the field is not blank.
\mSpecifies that the MergeField field is a mapped field.
\vEnables character conversion for vertical formatting.

Inserting

You can insert a Merge field through the InsertField() method of RadFlowDocumentEditor. The method accepts code as the first argument and result as the second argument.

Example 1: Insert a Merge field

C#
editor.InsertField("MERGEFIELD First_Name", "«to be updated»");

Example 2: Insert a Merge field with switches

C#
editor.InsertField("MERGEFIELD First_Name \\b \"Mr. \" \\f \". \"", "«to be updated»");

Example 3: Insert a Merge field with a Date-Time format switch

C#
editor.InsertField("MERGEFIELD Date_Time \\@ \"MM/dd/yy\"", "«to be updated»");

After updating the field, the result is "05/13/21".

See Also