Views:

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

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:

  1. Create a System View containing all fields to be inserted in your letter (or ensure one already exists)
  2. Create or edit a Word document.
  3. Insert merge fields using Word’s "Quick Parts" tool.
  4. Upload the document in akoyaGO as a Letter Template File.
  5. 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 TypeDescriptionSyntax ExampleExample Output / Notes
Basic MERGEFIELDInserts one field into the document as-is.{MERGEFIELD "Request #"}Displays the field value exactly as returned by the merge.
Combined Text with Merge FieldsCombines normal sentence text with multiple inserted fields.Request {MERGEFIELD "Request #"}: {MERGEFIELD "Title"}Useful for document headings, summaries, and labels.
Uppercase FormattingConverts inserted text to ALL CAPS.{MERGEFIELD "Purpose" \* Upper}Example: TO ENRICH OUR COMMUNITY
Lowercase FormattingConverts 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 FormattingDisplays a stored date in a reader-friendly format.

{MERGEFIELD "Decision Date" \@ "MMMM d, yyyy"}

{MERGEFIELD "Decision Date" \@ "mm/dd/yyyy"}

Example: January 1, 2026

Example: 01/01/2026

Numeric FormattingFormats a number with commas and decimal places.{MERGEFIELD "Grant Amount" \# "#,##0.00"}Example: 1,250.00
Currency FormattingFormats a number as currency.

{MERGEFIELD "Grant Amount" \# "$#,##0.00"}

{MERGEFIELD "Grant Amount" \# "$#,##0"}

Example: $1,250.00

Example: $1,250

Percentage FormattingDisplays 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 LogicDescriptionSyntax ExampleExample 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: 

  • If the Request Status equals Approved, it shows “Congratulations”
  • Otherwise, it shows “Please apply again next year.”
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: 

  • If the Purpose is anything other than “General Support”, it shows “special project grant”
  • If it does match that exact phrase, it shows “general support grant”

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: 

  • If the Grant Amount is under 1000, it shows “Small Grant”
  • If it is 1000 or more, it shows “Large Grant”

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: 

  • If the Decision Date is June 30, 2026 or earlier, it shows “On or before”
  • If it’s later, it shows “After”
Nested IFsEvaluates 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:
First checks: is Grant Amount ≥ 5000?

  • If YES:
    • If Status = Approved → “Flagship award”
    • Otherwise → “Large award”
  • If NO (< 5000) → “Standard award”
Conditional Formatting by Numeric RangesPlaces 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:
Categorizes the amount into tiers:

  • ≥ 10,000 → “Tier 3”
  • ≥ 2,500 (but less than 10,000) → “Tier 2”
  • Less than 2,500 → “Tier 1”
    Formula AdditionAdds a fixed amount to a merged numeric value.

    {= { MERGEFIELD "Annual Income" } + 1000}

    Calculates after the merged value is inserted.

    What this example would do: 
    Adds 1000 to the Annual Income

    Formula SubtractionSubtracts 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 MultiplicationMultiplies 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 DivisionDivides 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 TypeDescriptionSyntax ExampleNotes
    HYPERLINK from a URL Field with Word-Defined Display TextUses a merged URL as the hyperlink destination and uses normal Word content for the visible text.

    {HYPERLINK "{ MERGEFIELD Website }"}

    {MERGEFIELD "Contact #"}

    The HYPERLINK field defines the destination. The separate merge field defines the visible clickable text.
    HYPERLINK with [[text:...]] MarkerUses 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 FieldBuilds 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 PatternDescriptionSyntax ExampleNotes
    Picture Merge from Image FieldUses 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 SwitchPreserves 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 SwitchesFits 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 FieldUses 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 URLBuilds 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 \* Caps for 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

    1. Confirm the field/column exists in the System View.
    2. Confirm the record for which you are generating a letter contains data.
    3. Confirm the field name in Word exactly matches the System View column name.
    4. Use the field label, not the logical name, for image merge fields such as Picture:Public Fund Image.
    5. Press Alt + F9 if Word shows rendered values and you need to inspect or edit field codes.
    6. 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.