Including Merge Fields in Word Templates and Stationery

You can include Merge Fields in a Word Template or Stationery to bring in content from your practice management software and from FYI.

For an overview of how Merge Fields are used, refer to Setting up Document Templates and Stationery. For general information on creating and updating Templates and Stationery in FYI, refer to Creating Stationery for Word and Creating Templates for Word, Spreadsheet or Presentation.

Understanding Merge Fields

Merge Fields are added to the content of the Word Template or Stationery and need to be added in a specific format.

Standard Fields

Standard fields generally follow the format of «(field name)», for example, «ClientName».

To make it easy, the FYI Merge Fields Comprehensive Guide for a list of Merge Fields that you can copy and paste into your Templates and Stationery (or download the file from the bottom of this article).

Click here to download the FYI Merge Fields Comprehensive Guide.

2837_Merge_Fields_Guide.png

Note: There is a known issue where the values are not currently populated for the Merge Fields for Manager Phone, Manager Mobile, Partner Phone and Partner Mobile.

An example of a Word template with Merge Fields is shown below.

446_Word_Stationery_with_Merge_Codes.gif

Custom Fields

If you have set up Custom Fields in your practice management software, UDFs in GreatSoft, or added Custom Fields directly in FYI, you can include Merge Fields for these in Templates and Stationery.

Custom Fields can be used, for example, to distinguish the client type (such as A, B or C grade clients) to record additional address or contact information, or for other indicators. Custom Fields display in the Client - Custom Fields and Job - Custom Fields tabs in FYI.

2047_Client_Custom_Fields_No_Edit.gif

When including Custom Fields in Word Templates and Stationery, you add them as Merge Fields from the Word Field function.

Custom Fields generally follow the format of "custom_(fieldname)", for example "custom_ClientLevel".

To ensure the field names are inserted correctly, there are rules that must be followed:

  • Prefix the Custom Field name with "custom_"

  • The Field name must exactly match the Custom Field name as it appears in FYI, including the same case. Refer to Managing Custom Fields for instructions on how to find the Custom Field name.

  • For Custom Field names with spaces, replace the space with an underscore (_).

  • Remove special characters from Custom Field names like full stops (.) or any other special characters (such as , or &).

For users of Xero Practice Manager, please note that Custom Merge Fields will only retrieve data from the Client, and not the Job.

For example:

Custom Field Name Merge Field Name
Types custom_Types
Skype Call custom_Skype_Call
z2.1 Name custom_z21_Name

Creating the Word Template or Stationery

Before you Begin

Before creating your Word Template or Stationery, you must keep in mind the following:

Signature Merge Field
When sending documents for signature via Annature or FuseSign you need to ensure the document you send has the Signature Merge Field included in the document. The Signature Merge Field is automatically detected as a placeholder where the recipient has to sign, this does not show the sender's signature. Refer to Digital Signatures using Annature and Digital Signatures using FuseSign.

Word Fields that give a Prompt, such as Ask and Fill-in
The Word Fields that give the user a Prompt, such as Ask and Fill-in are not compatible with FYI Templates and Stationery, and cannot be used.

Step 1 - Create a Template or Stationery in FYI

In FYI, create your Word Template or Stationery in FYI in the usual way (refer to Creating Stationery for Word and Creating Templates for Word, Spreadsheet or Presentation).

Step 2 - Open the Template in Word Desktop Version

When adding Merge Fields to a Word document, this must be done using the desktop version of Word. The functionality is not available in the Online version of Word.

  • If you have prepared the Word document and will be using drag and drop or Upload to import it as a Template, you can add the Merge Fields to the document using the desktop version of Word.
  • If you will be editing the Template or Stationery from FYI, you need to use the Edit from Desktop function.

Step 3 - Design your Template or Stationery

Begin adding the content to your Template.

For now, leave blank sections where the data will be inserted by merge fields. This will be covered in the next step.

2846_Word_Document_Merge_Empty.gif

Step 4 - Insert Standard FYI Merge Fields

If inserting a standard FYI merge field, you can copy and paste the Merge Field from the FYI Merge Fields Comprehensive Guide. Alternatively, standard fields can be inserted in the same method as Custom Fields, covered in Step 5.

  1. Download the FYI Merge Fields Comprehensive Guide document (refer above to Downloading the FYI Merge Fields Comprehensive Guide).
  2. In the FYI Merge Fields Comprehensive Guide document, find the field you want.
  3. Select the field from the left-hand column and copy it.
    In the following example, this is copying the Merge Field for "Addressee".
    454_Copy_from_Merge_Fields_Document.gif

  4. Paste the field into your Word document in the location that you want to show the contents of the field.

Step 5 - Insert Custom Fields using the Word Insert Field Function

Custom Fields are inserted using the Word Insert Field function. 

Note: When using this method, omit the angled brackets from the start/finish of the Merge Field.

  1. Go to the location in the Word document that you want to show the contents of the field.
  2. From the Word ribbon menu, select Insert - Quick Parts - Field (in the text section of the ribbon).

    453_Word_Quick_Parts.gif
  3. Select the Field named MergeField.
  4. Enter the Merge Field Name, for example "Addressee" (for a standard field) or "FYI_custom_ClientLevel" (for a custom field).
    Note: Follow the guidelines for Custom Fields above, ensuring you replace any special characters or spaces.
  5. Click OK to add it to the Word document.

When the Merge Field is added to the Word document it shows with angled brackets, for example,

«custom_ClientLevel»

456_Merge_Field_for_Custom_Field.gif

Step 6 - Test the Template

Save the changes to the Template, and either upload it to FYI or click I am finished editing to synchronise the changes. Refer to Creating Templates for Word, Spreadsheet or Presentation for instructions.

You should now test the file by creating a Word document from the Template. The Word Document that is created can be previewed or edited using the online version of Word (the Desktop version is only required when creating the template).

Note: Ensure the Template is marked as "Active" in the Filing section to become available to create documents.

Updating Merge Fields

You can make any changes to Templates or Stationery that include Merge Fields by editing it directly in FYI using Word desktop. Refer to Making Changes to a Template in Creating Templates for Word, Spreadsheet or Presentation.

To change a Merge Field in a Word document:

  1. Right-click on the Merge Field and select Edit Field.

    457_Edit_Merge_Field.gif

  2. The Field pop-up displays. Make any changes as needed and click OK.
  3. Right-click again on the Merge Field and select Update Field.

Advanced Formatting

Today's Date

There are two ways to add 'today's date' to a document via an FYI template or stationery. Use whichever is appropriate if you want the date updated when a document is reopened, or if you want to retain the original creation date.

  • FYI CreatedDate Merge Field
    Using the FYI CreatedDate Merge Field adds the current 'today's date' when a document is created from the template/stationery and this original creation date is retained whenever the document is opened or downloaded.

  • Office Date field
    Using the Date field will add 'today's date' when the document is created from the template/stationery, but it will reset the date to the current date whenever the document is opened or downloaded.

Formatting the CreatedDate Merge Field

You can add a switch to the Merge Field to format the date. This allows you to set it to display, for example, as 5 Feb 2021, as 5 February 2021, Friday, 5 February 2021, etc.

  1. Edit the Word Template or Stationery using the desktop version of Word.
  2. Right-click over the CreatedDate merge field.
  3. From the Word pop-up menu, select Toggle Field Codes.
    The Merge Fields displays as a code in your Word document and shows as follows:
    {MERGEFIELD CreatedDate }
    or as
    {MERGEFIELD CreatedDate \* MERGEFORMAT}
  4. Add the formatting switch using the examples below.
    Ensure there is a space after the word CreatedDate, after the opening bracket { and before the closing bracket }.
    If \* MERGEFORMAT is shown, the switch should replace this.
Merge Field Code Displayed Result
(for a date 5th February 2021)
{ MERGEFIELD CreatedDate \@ “dddd, d MMMM yyyy” } Friday, 5 February 2021
{ MERGEFIELD CreatedDate \@ “ddd, d MMMM yyyy” } Fri, 5 February 2021
{ MERGEFIELD CreatedDate \@ “d MMM yyyy” } 5 Feb 21
{ MERGEFIELD CreatedDate \@ “MMM d yyyy” } Feb 5 21
{ MERGEFIELD CreatedDate \@ “dd/MM/yy” } 05/02/21

Note: In the Word formatting, m is used for minutes in a date/time field. Use M (capital M) for month.

Office Date Field

To include the Office "Date" Field:

  1. From the Word ribbon menu select Insert - Quick Parts - Field
  2. In the list of Field names, select the field "Date".
  3. Select the format required.
  4. Click OK to add the field.

455a_Quick_Parts_Date_Field.gif

Conditional Merge Fields

Word supports conditional merge fields.

Note: The following example shows a Custom Field with the prefix custom_

For example, you can use a conditional merge field if you wanted to use a Custom Merge Field "Preferred_Name" if this was available, or if not use the Merge Field "Salutation".

Microsoft Word Conditional Merge Field Description
{ IF { MERGEFIELD custom_Preferred_Name } = "" { MERGEFIELD Salutation }{ MERGEFIELD custom_Preferred_Name } \* MERGEFORMAT} If the Merge Field “Preferred Name” is available use that, but if not, use the Merge Field “Salutation”.
{ IF { MERGEFIELD BusinessStructure \* MERGEFORMAT } = "Individual" "{ MERGEFIELD Addressee \* MERGEFORMAT }" "{ MERGEFIELD Addressee \* MERGEFORMAT } { MERGEFIELD ClientName \* MERGEFORMAT }" }

If the Business Structure is an individual then use the Addressee field. For all other Business Structures, display the Addressee Field (Primary Contact’s details) and then the Client Name (Company Name). 

Note: You need to right-click and use the Word function Toggle Field Codes to see the conditions. When Field codes are not enabled, the example above would show as Dear «XPM_Preferred_Name»

 

1395_Toggle_Merge_Fields.gif

Replace "custom_Client_Level" in the example above as relevant to use different Custom Fields or Merge Fields.

Refer to Microsoft Word help for more information on using conditional merge fields.

Checking Merge Fields in Word

If the correct value is not being pulled in for a Merge Field, you can check the actual value in the Word Template or Stationery.

Note: In Word, it is possible to change the text of the Merge Field without changing the field itself.

  1. Edit the Word Template or Stationery using the desktop version of Word.
  2. Right-click on the Merge Field in question.
  3. From the Word pop-up menu, select Toggle Field Codes.
    Or, to show all the Merge Fields as code in your Word document, click Alt+F9.

    For example, if you have Merge Field «OwnerName» this should show as follows:
    {MERGEFIELD OwnerName }
    or as
    {MERGEFIELD OwnerName \* MERGEFORMAT}

    When you toggle the Word Field Code, if it shows a different Merge Field, this is the value that will be pulled in.
    For example, if «OwnerName» is showing as {MERGEFIELD Manager \* MERGEFORMAT} it will pull in the Manager name, not the Owner.

  4. To correct a field, copy it in again from the FYI Merge Fields Comprehensive Guide
    or
    Right-click over it in Word and select Edit Field, then enter the correct name as per the document FYI Merge Fields Comprehensive Guide.

Download Files

Was this article helpful?
2 out of 3 found this helpful