logo
search
Document Editing Problems

How to Fix Word Mail Merge IF/THEN Rule with Multiple Fields

Bushra ParveenBushra Parveen Oct 23, 2026 869 views

Question details

The user needs to resolve an issue where a Mail Merge IF/THEN rule stops processing after the first merge field or displays raw field codes instead of inserting the intended paragraph with multiple fields.

How to Fix Word Mail Merge IF/THEN Rule with Multiple Fields
Product
Word
Device & OS
not provided
Scenario
Setting up a Mail Merge document that uses an IF/THEN condition to output a full paragraph containing several different merge fields.
Observed behavior
The IF/THEN rule fails to evaluate completely, stopping at the first nested merge field or displaying field codes instead of the full evaluated text.
Before you start

Before troubleshooting, press Alt+F9 (Option+F9 on Mac) to toggle your document's field codes, which allows you to view the underlying structure of your IF/THEN rules and spot any manual typing errors.

Solution 1Recommended

Reconstruct the IF/THEN Rule Using System Field Braces

Manually typing braces or chevrons causes merge errors. You must use system-generated field braces and properly nest the merge fields inside the condition using Word's interface.

A common cause for Mail Merge conditions breaking is the manual typing of curly braces { } or chevrons << >>. Word relies on hidden code structures to recognize these as dynamic fields, which can only be generated via shortcuts or the ribbon menu.

1
Delete the faulty fields

Highlight and delete the existing IF/THEN rule and any stray merge fields that were placed outside the intended condition block.

2
Insert system field braces

Press Ctrl+F9 on your keyboard to insert a new pair of blank field braces { }. Do not type these manually using the keyboard.

3
Build the conditional statement

Inside the new braces, type your IF statement structure, such as: IF { MERGEFIELD Condition } = "True" " ".

4
Insert nested merge fields

Place your cursor inside the true/false result quotation marks. Go to the Mailings tab, click 'Insert Merge Field', and select the multiple required fields to add them into the paragraph.

Reconstruct the IF/THEN Rule Using System Field Braces
Important Formatting Rule: Always use the 'Insert Merge Field' button on the toolbar or Ctrl+F9 for every single field inside the paragraph. Typing chevrons manually will permanently break the rule.
Advanced Document Merging

Master Mail Merge with WPS Writer

WPS Writer offers a highly intuitive and robust Mail Merge feature that handles complex IF/THEN rules and multiple nested fields with ease. Creating dynamic conditional documents is straightforward, helping you avoid broken field codes while remaining fully compatible with Word formats.

  1. 1. Access Mail Merge tools: Open your document in WPS Writer, go to the 'References' or 'Mailings' tab, and select 'Mail Merge' to reveal the dedicated merging toolbar.
  2. 2. Connect your data source: Click 'Open Data Source' to seamlessly link your Excel spreadsheet, CSV, or database containing the dynamic merge data.
  3. 3. Insert rules and fields: Use the 'Insert Merge Field' and 'Rules' buttons to safely construct complex conditional paragraphs and IF/THEN statements without ever typing manual field codes.
  4. 4. Preview and finish: Click 'View Merged Data' to instantly preview your conditional fields. Once satisfied, click 'Merge to New Document' or 'Merge to Printer' to complete the process.
Fully compatible with Microsoft Word documents and complex Mail Merge structuresIntuitive Mail Merge interface for visually adding multiple conditional rules and fieldsLightweight application that processes large data sources quickly and smoothlyFree to download and use for all your essential document processing needs
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Mail Merge show field codes instead of data?

You likely have field codes toggled on, or you typed the curly braces manually. Press Alt+F9 (or Option+F9 on Mac) to toggle the view. If it still doesn't work, recreate the braces using Ctrl+F9.

Can I put multiple merge fields inside an IF/THEN rule?

Yes, you can include multiple merge fields within the result quotes of an IF statement. However, each nested merge field must be properly inserted using the 'Insert Merge Field' tool rather than typing the field names manually.

What should I do if my IF rule stops evaluating after the first nested field?

This usually indicates a broken field code or corrupted formatting. You should highlight and delete all nested merge fields inside the IF condition, then reinsert them directly through the Mailings toolbar.

Does formatting inside the IF/THEN result apply to the merged document?

Yes, any text formatting (like bold, italics, or specific fonts) applied to the merge fields or standard text inside the IF/THEN quotation marks will successfully carry over to the final merged document.