How to Fix Extra Blank Lines from Multiple IF Fields in Word Templates
Question details
The user needs to remove unwanted blank lines that appear in a Word document when multiple consecutive IF field conditions evaluate to false during a data merge.
- Product
- Word
- Device & OS
- not provided
- Scenario
- Merging data into a Word template via Conga Composer and Salesforce where multiple IF conditions exist.
- Observed behavior
- When all IF conditions are false, the fields leave behind unwanted paragraph spacing, creating a large, empty blank area in the final document.
Before adjusting your fields, toggle the 'Show/Hide ¶' button in your word processor to make paragraph marks and hidden formatting visible so you can easily identify the source of the blank spaces.
Move Paragraph Marks Inside the IF Field Condition
Enclose the paragraph mark within the true-text condition of the IF field to ensure the line break only renders when the condition is actually met.
By default, if a paragraph mark sits outside the IF field code, the word processor will render a blank line even if the field's outcome is empty. Moving the paragraph mark inside the quotation marks of your 'true' statement prevents this.
Press Alt + F9 on your keyboard to toggle on field codes in your Word template so that you can see the underlying formulas.
Find the section of your IF field formula that specifies what text should appear when the condition is true (usually enclosed in quotation marks).
Place your cursor at the end of the true-text string (but inside the closing quotation mark) and press Enter to insert a paragraph mark (¶) directly into the condition.
Delete any paragraph marks that sit immediately outside or between the consecutive IF fields to completely remove the extra blank lines.
Manage Conditional Fields Easily with WPS Writer
WPS Writer provides comprehensive support for standard field codes, mail merges, and formatting tools, allowing you to seamlessly manage complex document templates without layout errors.
- 1. Open Your Template: Launch WPS Writer and open your .docx template file containing the IF fields.
- 2. Enable Editing Marks: Go to the Home tab and click the 'Show/Hide Editing Marks' icon to make paragraph formatting visible.
- 3. Edit Field Codes: Right-click the field or use standard shortcuts to toggle field codes and adjust your paragraph spacing directly inside the true-text conditions.

Frequently Asked Questions
Why do IF fields create blank lines when the condition is false?
Even if an IF condition evaluates to false and returns no text, any paragraph mark placed after the field code is still processed as a normal line break. Multiple false conditions in a row stack these empty paragraph marks, causing large blank areas.
How do I view hidden field codes in my template?
You can view hidden field codes by pressing Alt + F9 on Windows. This shortcut toggles the document view between the final field results and the underlying field formulas, allowing you to edit the syntax.
Will this formatting fix work with Conga Composer and Salesforce?
Yes. Conga Composer relies on standard Word field formatting. By structuring the paragraph marks into the true-text portion of the IF field, Conga will accurately suppress the line break when the Salesforce data is empty or evaluates to false.




