Mail Merge Rule with Multiple Conditions

0 Flares 0 Flares ×

Mail Merge can handle conditional rules such as If… Then… Else… to display different text depending on the information in the data source record. Normally these rules are quite simple tasks such as; if the member joined within the last month, or if they have a family membership.

Sometimes though you may need to use multiple conditions. For example, you may want to check if a member of a club had a Gold, Silver or Bronze membership. The new price of their membership depends on what membership they have.

Begin by inserting a basic If… Then… Else… rule. This gives you a head start with typing the rules by inserting the structure of the condition. It’s easier to expand on this rule, than write one from nothing.

  1. Click on the Rules button in the Write & Insert Fields group of the Mailings tab

Mail Merge rules

  1. Select If… Then… Else… from the list
  2. Build the condition by selecting the Field name and  Comparison operator from the lists and then typing the value you want to check against in the Compare to box
  3. Type the text you want to show if the condition is true in the Insert this text box

Creating an If... Then... Else... Mail Merge rule

  1. Click Ok

The text will show in the document if it matches the condition for the first record from the data source.

To expand on this criteria we need to see the field code. Press Alt + F9 to view the field code. The code will look like below;

{ IF { MERGEFIELD Membership } = “Gold” “66” “” }

To use multiple conditions, you can add more If’s to the code. The example below shows the different amounts being displayed for the different types of membership.

{ IF { MERGEFIELD Membership } = “Gold” “66” { IF { MERGEFIELD Membership } = “Silver” “55” { IF { MERGEFIELD Membership } = “Bronze” “46” } } }

Pressing Alt + F9 at any point will switch between showing the field codes or not.

5 thoughts on “Mail Merge Rule with Multiple Conditions

  1. this is all well and good but what about the other rules.
    Several sites I visited only explain the if then statement.
    What do the other rules do and how do I properly use them. That was what i was really looking for.

Leave a Reply

Your email address will not be published. Required fields are marked *