Views:

Revised 05/12/2026

 

Prerequisites

This article explains how Merge Fields and Conditional Logic work in akoyaGO Letter Templates, including why letter content may differ between records and what behavior is expected.

How Letter Templates Work 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.

  1. Create a System View containing all required fields
  2. Create or edit a Word document
  3. Insert merge fields using Word’s Field tool
  4. Upload the document as a Letter Template File
  5. Generate letters from akoyaGO

Important: Merge Field names must exactly match System View column names.

Merge Fields & Conditional Logic

Merge Fields insert data from akoyaGO records into a letter. Some templates also contain logic that automatically changes wording based on record values.

The table below provides a reference overview of logic supported by Microsoft Word and respected by akoyaGO when generating letters.

Type of LogicDescriptionSyntax ExampleNotes
IF StatementConditionally displays text{ IF "{ MERGEFIELD FieldName }" = "Value" "TrueText" "FalseText" }Most common conditional logic
ComparisonCompares a field to a value{ IF "{ MERGEFIELD FieldName }" > 100 "Above 100" "100 or below" }Supports =, >, <, >=, <=
Nested IFsEvaluates multiple conditions{ IF "{ MERGEFIELD Score }" >= 90 "Excellent" "{ IF "{ MERGEFIELD Score }" >= 75 "Good" "Needs Improvement" }" } Advanced / power‑user logic
Date FormattingControls date display

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

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

Example: January 1, 2026

Example: 01/01/2026

Currency FormattingFormats currency values

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

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

Example: $1,250.00

Example: $1,250

 

Best Practice: Apply explicit 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.

View existing Mergefield Formatting in a Letter Template

1. Open your Letter Template File and press Alt + F9. This reveals all mergefield formatting within the template (example below). To hide the formatting, press Alt + F9 again.

 

How to update date formatting in your existing Letter Template file

1. Open your Letter Template File and highlight the date field you want to format. Right click and select "Edit Field..."

 

2. Click on the "Field Codes" button in the lower left hand corner:

Note: Any existing formatting will not display here. To view currently applied formatting, see previous section.

3. Insert a "\" and then your date format into the "Field codes:" box. This will replace any previously applied formatting. The example below shows the formatting for a long-date, which will make your date field display like this: January 1, 2026

4. Save your updated letter template file as a new file.

5. Return to the Letter Template record in akoyaGO and click on the Letter Template File lookup:

6. Replace your old Letter Template File with your newly created one by clicking the "Delete" button and uploading your newly saved formatted Word Document:

Why Letter Content May Change

    • Different records contain different data
    • Some fields may be blank
    • Status values vary
    • Conditional sections may not apply

    Common Issues & Best Practices

    1. Confirm the field exists in the System View
    2. Confirm the record contains data
    3. Save and regenerate the letter
    4. Avoid manually editing generated letters

    Best Practice: Always fix the template or data source—do not manually patch output letters.