MailMerge is a feature in various software platforms that allows for the population of a ‘template’ document with information related to the recipient of a document. For example, if you are sending out letters to job applicants for an interview, the template may include fields for the applicant name, the interview time and address of the recipient, along with some text that will go to all recipients, such as the body of the letter detailing the format of the interview and what to bring along. With eBMS MailMerge, users can populate a template with data from their platform – this page will explain how use the feature.
Creating a template
To create a template document, you’ll need to open up Word and write the document as you would normally, but in the place where you would like a piece of data from an eForm Record you will need to add a Merge Field. To insert a mergefield:
- Click Insert -> Quick Parts -> Field…
- In the window that appears, select MergeField in the list of Field names on the left.
- Enter the name of your MergeField. This should be the same name as the data field on your eForm.
- Click OK to insert the mergefield into your document at the caret position.
Sometimes you’d like to selectively display or disable a block of text, depending on a condition. For example, if a recipient needs to bring a portfolio to their interview, you can add this line to your template and make it only appear if a field on your eForm Record is set to a certain value. To add a conditional mergefield:
- Click Insert -> Quick Parts -> Field…
- In the window that appears, select If in the list of Field names on the left.
- In the “Field codes” section, enter the format of your IF statement. This window doesn’t really allow much more than a single line of regular text, so you can just put some placeholder values in there:
IF "BringPortfolio" = "TRUE" "truetext" "falsetext"
Because this formula is dependent upon spaces to mark the start of the next argument, it’s best to surround these values with quotation marks to allow you to use multiple words in an argument.
- Click OK to insert the IF statement into your document at the caret position.
- Right-click the inserted field and click Toggle Field Codes to view the contents of the IF statement. It should look something like this:
- To insert a mergefield into your IF statement, select the text you want to replace with a mergefield (in our example, I would select “BringPortfolio”) and perform the steps above for inserting a mergefield.
- To apply more advanced formatting to your IF statment, edit the contents of the true result and false result between the quotation marks.
One common example of usage for an IF statement is to conditionally add a piece of text. In this example, if the Bring Porfolio field is TRUE, then a new line will be added with the text “Please bring a portfolio of recent work along to your interview”. If the Bring Portfolio field is not TRUE, then no text will be shown:
Using a template
In order to populate a template document in your eBMS platform, you’ll need to upload the file to the platform at the right place.
- Open your eBMS platform in a web browser
- On the top bar, click the eForms link.
- You should see a list of the eForms on your system. Select the desired eForm and click Tasks to the left.
- A small window should open with a number of options. Click the Manage eForm link to go to the Manage eForm page. If you can’t see this option, you might not have sufficient permissions to access this page.
- On the Manage eForm page, you should see a box titled Manage MailMerge Templates containing a File Explorer. Click the Upload button to upload your template.
- In the Upload files window that appears, click Browse… and select your document template. Click Upload to upload the template.
- Click Close to close the Upload files window – you should see your template in the list of files.
Now that you’ve uploaded your template you can populate it from either an eForm Record or a Tabular Report. Populate from a single record to receive a single copy of the template populated from the open record, or from a tabular report to receive a copy of the template for each record in your tabular report (you can use the filtering system to filter down to just the records you want to use)
The process is the same for both locations:
- Open your eForm Record or Tabular Report.
- Ensure the sidebar is open – if not, click the <- button on the left of the page.
- Under the Export heading in the sidebar, click MailMerge Export.
- A new window should open, titled Export to Docx, showing a list of MailMerge templates for this eForm. Select your desired template by clicking it.
- You should now receive a download prompt to download the filled template. Save the file and open it to view the populated template.
- If you have used a conditional field like an IF statement in your template, you will probably be warned that some fields need to be updated. Click Yes so that the fields can update themselves.
Updating existing templates
In order to change/update an existing template which has been uploaded and in use, please follow below steps:
- Repeat steps 1-4 listed in Using a template section
- On the Manage eForm page, you should see a box titled Manage MailMerge Templates containing a File Explorer which displays all the templates have been uploaded. Find the one you would like to update and click the globe image to download a copy to your computer.
- Update/Change the template downloaded as needed – refer to Creating a template section for detail.
- Delete the template you want to update from the File Explorer on the Manage eForm page. The template can be deleted by selecting the template and clicking the red button on the top (next to the green upload button)
- Upload the template you updated to the File Explorer – refer to steps 5-7 in section Using a template. Please ensure the updated template name is exactly the same as before.
- It’s important to use the exact name of the eForm column when naming your mergefields. If you want to confirm the exact column name, you can do so by opening a Tabular Report for your eForm and selecting the All Columns Profile. This will give you a full list of the column names (column headings on the tabular report)
- Remember that ‘IF’ type fields in Word distinguish their parts by checking for spaces. Put the Expression1, Operator, Expression2, TrueText and FalseText arguments inside “quotation marks” or you might find that the field doesn’t give you the result you expected.