Revised 05/07/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
- Merge Fields & Conditional Logic
- Why Letter Content May Change
- Common Issues & Best Practices
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.
- Create a System View containing all required fields
- Create or edit a Word document
- Insert merge fields using Word’s Field tool
- Upload the document as a Letter Template File
- 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.
Some advanced scenarios may require editing Word field logic directly. Power users can reference:
Advanced Logic Reference for Letter Templates
The table below provides a reference overview of logic supported by Microsoft Word and respected by akoyaGO when generating letters.
| Type of Logic | Description | Syntax Example | Notes |
|---|---|---|---|
| IF Statement | Conditionally displays text | { IF "{ MERGEFIELD FieldName }" = "Value" "TrueText" "FalseText" } | Most common conditional logic |
| Comparison | Compares a field to a value | { IF "{ MERGEFIELD FieldName }" > 100 "Above 100" "100 or below" } | Supports =, >, <, >=, <= |
| Nested IFs | Evaluates multiple conditions | { IF "{ MERGEFIELD Score }" >= 90 "Excellent" "{ IF "{ MERGEFIELD Score }" >= 75 "Good" "Needs Improvement" }" } | Advanced / power‑user logic |
| Date Formatting | Controls date display | { MERGEFIELD Date \@ "MMMM d, yyyy" } | Example: January 1, 2026 |
| Currency Formatting | Formats currency values | { MERGEFIELD Amount \# "$#,##0.00" } | Example: $1,250.00 |
Best Practice: Apply explicit date 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.
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
- Confirm the field exists in the System View
- Confirm the record contains data
- Save and regenerate the letter
- Avoid manually editing generated letters
Best Practice: Always fix the template or data source—do not manually patch output letters.
