TABLE OF CONTENTS
How to add conditional text in a Mail Merge template
This will enable the user to amend the text displayed based on the value returned on a mail merge field. For example, use the text Boys where the pupil gender is Male, and Girls if Female.
The text required is {IF <<Gender>>=”Male” “Boys” “Girls”} but this statement needs to be entered as follows:
- Open the Mail Merge template to be updated
- Select Show All Field Codes
- Place the cursor where you want the conditional text displayed on the template
- Control F9 to create the start/end brackets
- Type IF
- Space
- Select Insert Mail Field and choose the subject field (in the example this is Gender)
- The double chevrons will be added to the start and end of the selected field
- =
- In quotations, enter the mail merge outcome you are looking for (in the example this is where Gender = Male)
- Space
- In quotations, enter the text you want displayed if the mail merge outcome is true (in the example this is boys where Gender = Male)
- Space
- In quotations, enter the text you want displayed if the mail merge outcome is false (in the example this is girls where Gender = not Male)
- Close and save the updated template
Note that if the template is re-opened later the text updates to {IF { MERGEFIELD Gender}=”Male” “Boys” “Girls”}
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article