Revised 06/17/2026
Prerequisites
This article explains how to use Merge Fields, Formatting, Conditional Logic, Hyperlinks, and Images in akoyaGO Letter Templates.
- Letter Templates in akoyaGO
- Merge Fields and Conditional Logic
- Merge Field Formatting Options
- Formulas and Conditional Logic Examples
- Hyperlinks and Text Markers
- Merge Images
- View Existing Merge Field Formatting in Letter Template File
- How to Update Formatting in Existing Letter Template File
- Why Letter Content May Change
- Common Issues & Best Practices
Letter Templates in akoyaGO
akoyaGO Letter Templates are created using Microsoft Word and powered by System Views. Each column in the System View represents data that can be inserted into a letter.
For a step-by-step overview of creating and generating letters, see Generating Letters in akoyaGO CRM Using Letter Templates.
The high-level steps to create a Letter Template include:
- Create a System View containing all fields to be inserted in your letter (or ensure one already exists)
- Create or edit a Word document.
- Insert merge fields using Word’s "Quick Parts" tool.
- Upload the document in akoyaGO as a Letter Template File.
- Generate letters from akoyaGO.
Important: Merge Field names must exactly match System View column names. For image fields, use the field label in the template, not the logical name. For example, use {MERGEFIELD "Picture:Public Fund Image"}, not {MERGEFIELD "Picture:akoya_publicfundimage"}
Merge Fields and Conditional Logic
Merge Fields insert data from akoyaGO records into a letter. Templates can also include formatting switches, formulas, IF statements, hyperlinks, and image fields that automatically change the output based on the record being merged.
To toggle between displaying field codes (including formatting switches) and the actual results, press Alt + F9. More information on updating formatting is included in the sections below.
Merge Field Formatting Options
The table below provides a reference overview of common merge field formatting supported by Microsoft Word and respected by akoyaGO when generating letters.
Best Practice: Apply formatting to all date fields used in your Letter Template. This ensures dates display consistently and clearly in generated letters, regardless of how the data is stored in akoyaGO.
| Formatting Type | Description | Syntax Example | Example Output / Notes |
|---|---|---|---|
| Basic MERGEFIELD | Inserts one field into the document as-is. | {MERGEFIELD "Request #"} | Displays the field value exactly as returned by the merge. |
| Combined Text with Merge Fields | Combines normal sentence text with multiple inserted fields. | Request {MERGEFIELD "Request #"}: {MERGEFIELD "Title"} | Useful for document headings, summaries, and labels. |
| Uppercase Formatting | Converts inserted text to ALL CAPS. | {MERGEFIELD "Purpose" \* Upper} | Example: TO ENRICH OUR COMMUNITY |
| Lowercase Formatting | Converts inserted text to all lowercase. | {MERGEFIELD "Purpose" \* Lower} | Example: to enrich our community |
| Caps (Title Case) | Capitalizes the first letter of each word. | {MERGEFIELD "Purpose" \* Caps} | Example: To Enrich Our Community |
| Date Formatting | Displays a stored date in a reader-friendly format. |
| Example: January 1, 2026 Example: 01/01/2026 |
| Numeric Formatting | Formats a number with commas and decimal places. | {MERGEFIELD "Grant Amount" \# "#,##0.00"} | Example: 1,250.00 |
| Currency Formatting | Formats a number as currency. |
| Example: $1,250.00 Example: $1,250 |
| Percentage Formatting | Displays a number as a percentage. | {MERGEFIELD "Grant Amount" \# "0.00%"} | Example: 0.25 → 25.00% |
Formulas and Conditional Logic Examples
akoyaGO Letter Templates also support Word formulas and conditional logic. These examples show common patterns for text conditions, numeric comparisons, and formulas that calculate values during document generation.
| Type of Logic | Description | Syntax Example | Example Output/Notes |
|---|---|---|---|
| IF Statement (String Equality) | Conditionally displays one result when a text value matches and another result when it does not. | {IF "{ MERGEFIELD "Request Status" }" = "Approved" "Congratulations" "Please apply again next year."} | Common for status-based language in letters. What this example would do:
|
| Comparison Operator <> | Checks whether a field is different from the comparison value. | {IF "{ MERGEFIELD "Purpose" }" <> "General Support" "special project grant" "general support"} | Use when a value should not equal the target text. What this example would do:
|
Comparison Operator < Comparison Operator > | Checks whether a value is greater than or less than the comparison value. | {IF "{ MERGEFIELD "Grant Amount" }" < 1000 "Small Grant" "Large Grant"} | Most often used with numeric comparisons. What this example would do:
|
Comparison Operator <= Comparison Operator >=
| Checks whether a date or value is earlier/less than or equal, or later/greater than or equal to the comparison value. | {IF "{ MERGEFIELD "Decision Date" }" <= "2026-06-30" "On or before" "After"} | Useful for cutoff dates and deadline messaging. What this example would do:
|
| Nested IFs | Evaluates multiple conditions using a direct Word-native nested IF pattern. | {IF { MERGEFIELD "Grant Amount" } >= 5000 { IF "{ MERGEFIELD "Request Status" }" = "Approved" "Flagship award" "Large award" } "Standard award"} | Useful for multi-step decision trees. What this example would do:
|
| Conditional Formatting by Numeric Ranges | Places a number into one of several ranges and returns a label. | {IF { MERGEFIELD "Grant Amount" } >= 10000 "Tier 3" { IF { MERGEFIELD "Grant Amount" } >= 2500 "Tier 2" "Tier 1" }} | Useful for tiers, bands, and ranges. What this example would do:
|
| Formula Addition | Adds a fixed amount to a merged numeric value. |
| Calculates after the merged value is inserted. What this example would do: |
| Formula Subtraction | Subtracts a fixed amount from a merged numeric value. | {= { MERGEFIELD "Annual Income" } - 2500} | Useful for offsets and simple reductions. What this example would do: Subtracts 2500 from the Annual Income |
| Formula Multiplication | Multiplies a merged numeric value by a fixed number. | {= { MERGEFIELD "Annual Income" } * 2} | Uses the standard Word equals-field pattern. What this example would do: Multiply Annual Income by 2 |
| Formula Division | Divides a merged numeric value by a fixed number. | {= { MERGEFIELD "Annual Income" } / 2} | Useful for halves, averages, or split calculations. What this example would do: Divide Annual Income by 2 |
Hyperlinks and Text Markers
Hyperlinks can be built from merged data in a template. The HYPERLINK field code defines the destination URL. The clickable text can come from normal Word display text or from a custom [[text:...]] marker placed after the hyperlink.
| Hyperlink Type | Description | Syntax Example | Notes |
|---|---|---|---|
| HYPERLINK from a URL Field with Word-Defined Display Text | Uses a merged URL as the hyperlink destination and uses normal Word content for the visible text. |
| The HYPERLINK field defines the destination. The separate merge field defines the visible clickable text. |
HYPERLINK with [[text:...]] Marker | Uses a custom marker after the hyperlink field to define visible text. | {HYPERLINK "{ MERGEFIELD Website }"} [[text:Website for contact #{ MERGEFIELD "Contact #" }]] | The text marker can combine static text and merge fields. |
| HYPERLINK Building a URL from a Field | Builds a dynamic URL from a merge field value. | {HYPERLINK "https://example.org/contact/{ MERGEFIELD "Contact #" }/profile"} | If no Word-defined display text or [[text:...]] marker is present, the merged output shows the resolved URL as the link text. |
Merge Images
akoyaGO Letter Templates can also merge images from akoyaGO. Image output can be controlled by the template placeholder geometry, field switches, and whether the image source comes from a record field or a URL.
| Image Pattern | Description | Syntax Example | Notes |
|---|---|---|---|
| Picture Merge from Image Field | Uses the Picture: merge-field naming convention to insert an image directly from a record field. | {MERGEFIELD "Picture:Public Fund Image"} | The placeholder shape in the Word template can control how the image is presented. |
Picture Merge with \x Sizing Switch | Preserves the template height while allowing the merged image width to expand to keep its aspect ratio. | {MERGEFIELD "Picture:Public Fund Image" \x} | Useful when the template box is narrow and tall. |
Picture Merge with \x \y Sizing Switches | Fits the merged image within the available template box while preserving aspect ratio. | {MERGEFIELD "Picture:Public Fund Image" \x \y} | Keeps the image inside the placeholder bounds instead of allowing it to expand beyond them. |
| INCLUDEPICTURE from an Image Field | Uses a Word INCLUDEPICTURE field with a nested MERGEFIELD as the image source. | {INCLUDEPICTURE "{ MERGEFIELD "Public Fund Image" }" \d} | The generation pipeline resolves the image during document generation and embeds it into the saved output. |
| INCLUDEPICTURE from a Dynamic HTTPS URL | Builds a dynamic image URL by inserting a merge field value into the URL text. | {INCLUDEPICTURE "https://placehold.co/600x200/png?text=Fund+{ MERGEFIELD "Fund Code" }" \d} | Useful when the image source is external and the URL needs to change per record. |
Important: Examples that use Picture: fields rely on the image field label exactly as it appears to the user. Do not substitute logical names in the merge field.
View Existing Merge Field Formatting in a Letter Template
1. Open your Letter Template File and press Alt + F9. This reveals all merge field formatting within the template. To hide the formatting, press Alt + F9 again.
How to Update Merge Field Formatting in Existing Letter Template File
1. Open your Letter Template File and highlight the field you want to update. Right-click and select Edit Field...
2. Click the Field Codes button in the lower-left corner.
3. Add the formatting switch you want to use in the Field codes: box. This replaces any previously applied formatting. For example:
\@ "MMMM d, yyyy"for long date formatting\# "$#,##0.00"for currency formatting\* Upper,\* Lower, or\* Capsfor text formatting
4. Save your updated letter template file as a new file.
5. Return to the Letter Template record in akoyaGO and click the Letter Template File lookup.
6. Replace your old Letter Template File by clicking Delete and uploading your newly saved Word document.
Why Letter Content May Change
- Records contain data formatted differently.
- Fields may be blank.
- Status values vary.
- Conditional sections may not apply.
- Formula results change based on the merged numeric values.
- Hyperlinks may display different visible text depending on whether the template uses Word display text, a
[[text:...]]marker, or neither. - Image presentation can change based on the placeholder shape, sizing switches, and the source image dimensions.
Common Issues & Best Practices
- Confirm the field/column exists in the System View.
- Confirm the record for which you are generating a letter contains data.
- Confirm the field name in Word exactly matches the System View column name.
- Use the field label, not the logical name, for image merge fields such as
Picture:Public Fund Image. - Press Alt + F9 if Word shows rendered values and you need to inspect or edit field codes.
- Save the updated template and regenerate the letter to test the result.
Best Practice:Prioritize correcting the template or data source; only edit individual output letters manually when absolutely necessary.
