This guide is intended to be used at the client’s own discretion. GivingData has provided common use cases for modifying merge fields and field codes based on scenarios which may benefit foundations for the purposes of grantmaking. GivingData does not currently support any of the below modifications aside from default field code switches available within the GivingData Add-In for Microsoft Word.
All modifications to GivingData merge fields are at the client’s own discretion and subject to the parameters and limitations of Microsoft Word.
Formatting or toggling merge fields in Microsoft Word allows you to control how information displayed by the merge field appears in document templates. The appearance of merge fields can be modified using various switches and parameters within the merge field itself. This allows you to ensure that merge fields display the information exactly as you want it to appear while maintaining their dynamic functionality.
The first step in modifying merge fields is to make the raw merge field parameters visible in Microsoft Word.
If using a Windows machine (and after inserting a merge field using the GivingData Add-In for Microsoft Word), right click and select Edit Field. If using a Mac machine, right click on the inserted merge field and select Toggle Field Code.
Once merge field parameters are visible, formatting can be modified. The sections below provide details on available options.
Basic Merge Field Syntax
Merge fields are enclosed in curly braces. For example: {MERGEFIELD FieldName}. Inside these braces, you can include additional information for formatting, which commonly follows a backslash \ after the specified merge field.
By default, the GivingData Add-In for Microsoft Word includes pre-formatting options for both currency and date fields.
- For example, to insert the current grant amount with a specific currency format, you can use the Currency Format or Date Format option before clicking Add Mergefield.
Currency format options in the add-in include:
- Show Decimals
- Show Whole Dollars/Pounds/CAD/AUD/Euros
- Currency conversion in Word is not available, however currency type will display as it is in GivingData.
Date format options in the add-in include:
- Short Date
- Long Date
- No Format
Using these options appends formatting to your Mergefield, shown if you right-click on the field and select Toggle Field Codes.
- For example, the Requested Grant Amount will look like {MERGEFIELD “Request.GrantAmount \\#0:C0” \* MERGEFORMAT} where \\#0:C0 indicates Show Whole Dollars while \\#0:C indicates Show Decimals.
Switches
Switches are used to modify the appearance or behavior of a merge field and can be added using the following methods:
- Manually, after adding the field to the document. Right-click, select Toggle Field Codes, and then insert modifier text.
- Automatically, by clicking the Options button when inserting a Mail Merge Mergefield.
Available switches include:
- \b – Specifies the text to be inserted before the MERGEFIELD field, if the field is not blank.
- \f – Specifies the text to be inserted following the MERGEFIELD field, if the field is not blank.
- \m – Specifies that the MERGEFIELD field is a mapped field.
- \v – Enables character conversion for vertical formatting.
- \*Upper – Capitalizes all letters.
- \*Lower – Makes all letters lowercase.
- \*FirstCap – Capitalizes the first letter of the first word.
- \*Caps – Capitalizes the first letter of each word.
Date and Time Formatting
Common switches for date and time merge fields include:
- @ "format" - Specify the desired date or time format. For example, \@ "MMMM d, yyyy" displays the full month name, day, and year.
- @ "HH:mm" - Display time in 24-hour format.
- @ "h:mm AM/PM" - Display time in 12-hour format with AM/PM.
| Switch | Description |
| Year | Use yy to display the last two digits of any year, or yyyy for the full four-digit year value. |
| Month | Use MMMM to fully spell out the month (e.g. September, October). Use MMM to display the three letter abbreviation for the month (e.g. Sep, Oct). Use MM to display the month in two digits with a leading zero for single digit months (e.g. 09, 10). Use M to display the month in non–leading zero digits (e.g. 8, 9,x 10). |
| Day | Use dddd to spell out the day of the week (e.g. Sunday, Monday). Use ddd to display the three letter abbreviation of the day (e.g. Sun, Mon). Use dd to display the day in two digits with a leading zero for single digit days (e.g. 09, 10). Use d to display the day in digits (e.g. 9, 10). |
Numeric Formatting
For merge fields that involve numbers, such as page numbers or calculations, numeric formatting switches can be used.
Examples include:
- # "0.00" - Displays a number with two decimal places.
- * MERGEFORMAT - Ensures that the formatting of the merge field matches the surrounding text.
Custom Character Spacing
Formatting can be created to customize the spacing and orientation of certain characters and digits based on how they are stored in GivingData, and how you want them to appear in your document template.
As an example, consider a 12-digit account number or serial number, “3451 23 09 8772,” assembled as a block of four digits followed by two blocks of two digits and a final block of four digits. In the GivingData database, this may be stored as a single number, “345123098772”.
- Inserting the merge field “{ MERGEFIELD SerialNo }” produces “345123098772.”
- However, a number can be reformatted using numerical field code logic. Instead of a single string of 16 digits, the modifier “\#” and a series of 0s can be used to reformat to the desired orientation. A merge field for this serial number with the desired formatting would then be: { MERGEFIELD SerialNo \# “0000 00 00 0000”} This produces: 3451 23 09 8772
Conditional Formatting
IF fields can be used to create conditional statements. The format should resemble the following: If MERGEFIELD operator VALUE TO COMPARE “Output if TRUE” “Output if FALSE”
For example, the following would display "High Value Grant" if the grant amount is greater than $50,000, and would otherwise display "Standard Grant":
{ IF { MERGEFIELD Request.GrantAmount } > 50000 "High Value Grant" "Standard Grant" }
Nested Fields
Merge fields can be nested within one another. For example, a date merge field can be nested within an IF merge field to display different dates based on certain conditions.
Update Fields
Merge fields may need manual updates after changes to the document. A merge field can also update automatically under certain circumstances. To manually update a field, right-click it and select Update Field.
Arithmetic Operations
Basic arithmetic operations (addition, subtraction, multiplication, division) can be performed on numeric merge field values.
For example, you can calculate a total by adding values from multiple fields: { = {Amount1} + {Amount2} }
- The following would display the percentage of a grantee’s net assets that are represented by the giving amount: { = { { MERGEFIELD Request.GrantAmount \* MERGEFORMAT } / { MERGEFIELD Organization.Financials_MostRecentYear_Assets \* MERGEFORMAT } } * 100 }