Mail Merge with Collection Builder

The Mail Merge Record Collection Action Builder retrieves records that match a Criteria and merges those records with a mail merge template.

media_1483689597511.png

Select the record type that will be merged with the template.

media_1481653248456-1.png

The Record Criteria will be used to ascertain which records to retrieve from the database.

media_1481653308160-1.png

Values can be passed into Criteria by creating a parameter.

By enclosing a value in { } brackets, that flags the word as a parameter. The name of the parameter, in the picture, would be statename.

Parameters will have the value substituted during the script execution.

media_1481653338047-1.png

If parameters are found in the Criteria, they wil be listed in the Name drop down.

Name – the name of the parameter within the criteria.

Type – type of value to be expected (String, Bool, Date, Decimal, Number).

Variable – the variable that will hold the value. The drop down will contain existing variables or type in a new variable name.

Click the Add button to add the parameter name and value to be substituted.

media_1481653369444-1.png

media_1481643190176-2.png

Select the Document Object Type that will contain your template.

media_1481643322085-2.png

The Template Criteria will be used to ascertain what document to be retrieved.

media_1481643368137-2.png

Values can be passed into Criteria by creating a parameter.

By enclosing a value in { } brackets, that flags the word as a parameter. The name of the parameter, in the picture, would be documentName.

Parameters will have the value substituted during the script execution.

media_1481643483651-2.png

If parameters are found in the Criteria, they wil be listed in the Name drop down.

Name – the name of the parameter within the criteria.

Type – type of value to be expected (String, Bool, Date, Decimal, Number).

Variable – the variable that will hold the value. The drop down will contain existing variables or type in a new variable name.

Click the Add button to add the parameter name and value to be substituted.

media_1481643494728-2.png

media_1481643537754-2.png

Click Yes to save the document as a Pdf.

File Path – the variable that will hold the path to the new document file. Note: this variable needs to be set before this point in the script.

Deleting the File Path variable name will bypass the saving file portion of the script.

media_1481643583941-2.png

Selecting Yes will send the document contents to the default printer.

Created Script

media_1481654326380.png

Add Text Criteria Parameter – maps a Criteria Parameter to a value to be substituted with.

Get Records – retrieves the records, in the database, that matches a Criteria and sets that record to a variable.

Add Text Criteria Parameter – maps a Criteria Parameter to a value to be substituted with. This parameter is for the document template.

Find Record By Criteria – retrieves the template record, in the database, that matches a Criteria and sets that record to a variable.

media_1481654352375.png

Get Record Content – gets the document content from the record.

New Document Item – creates a new DocumentItem and sets that to a variable.

Set DocumentItem Content – sets the newly created DocumentItem content to the record content variable.

Document Mail Merge – generates the template mail merge using all records retrieved.

media_1481654367392.png

Save Pdf File – takes a path and saves the final mail merge contents to that path.

Print Document – sends the final mail merge content to the default printer.

Tutorial