Example Conditional Statements

You can control your mail merge document output with conditional statements. These statements may be more or less elaborate as needed.

Check for 2nd Address LineClick to Open - Use conditional statements to check for an address second line, and ensure that there will no be a blank line in the letter or on the envelope when there is no second line. The example below tests to see if the variable is “not equal to nothing,” in other words that it is not blank. This concept can be applied in other conditional statements.

{MERGEFIELD resparty_full_name}{MERGEFIELD resparty_address_1}{IF {MERGEFIELD resparty_address_2} <> "" "{MERGFIELD resparty_address_2}"}{MERGEFIELD resparty_city}, {MERGEFIELD resparty_state} {MERGEFIELD resparty_zip}

Nested conditionsClick to Open - You can nest conditional statements within other conditional statements.

{IF {MERGEFIELD patient_userdef1} = "left" "We love our left-handed patients. " "{IF {MERGEFIELD patient_userdef1} = "right" "We love our right-handed patients. " "We can’t wait to meet you and see which hand you use. "}"}

Condition stringingClick to Open - If you are certain that no records will have a blank field for your variable, or if you desire the document to print nothing when it is blank, you can simply string conditional statements together rather than nesting them to make the form letter a little simpler to read.

A string of individual conditional statements:
{IF {MERGEFIELD doctor_abbr} = "JS" "Dr. Smith"}{IF {MERGEFIELD doctor_abbr} = "CJ" "Dr. Jones"}{IF {MERGEFIELD doctor_abbr} = "AB" "Dr. Brown"} looks forward to meeting you.

The same result, using nested conditional statements:
{IF {MERGEFIELD doctor_abbr} = "JS" "Dr. Smith" "{IF {MERGEFIELD doctor_abbr} = "CJ" "Dr. Jones" "{IF {MERGEFIELD doctor_abbr} = “AB” “Dr. Brown”}”}”} looks forward...

Table of Contents │ Get More Help │ Remote Support │ New Customer Care

Ortho2.com │1107 Buckeye Avenue │ Ames, Iowa 50010 │ Sales: (800) 678-4644 │ Support: (800) 346-4504 │ Contact Us

Chat with Software SupportChat with Network Engineering │ Chat with New Customer Care

Remote SupportEmail Support │ Online Help Ver. 12/18/2015