Document

A document action outputs a document by combining a template with system data through employing a Word mail merge,

Action Type

Set the Action Type to External Document to make the Document Tab accessible for configuration

Document

Creating an External Document requires a data source, in csv format, and document template, in Word format.

The System will use a Query to provide the data source before combining the data source with the Word template to deliver the required .docx or .pdf file.

Document Action Tab Confuguration

Data Query

This field identifies the query employed to provide the data fields that will be merged with the document template.

An existing query can be selected from the dropdown box or a new query can be created using the … query wizard.

The Data Query does not require specific filter criteria, the system will use information from the triggering Process to determine the record fields to use in the merge.

Additional SQL Criteria

This field allows for the entry of complex SQL criteria where the standard query wizard cannot present the data fields required.

This is for use by Advanced users.

Data Source

This field refers to the temporary data source that will be generated from the Data Query.

The Data Source will be a temporary .csv file that will exist only for the execution of each merge action, after which it will be removed.

Input the file path and name.csv

Take note of this entry as it will be required when you first combine the Template and Data Source fields using the EDIT button.

Note: File paths and names should not contain any spaces . This applies to Data Source, Template and Create field entries

Template

This field refers to the Word document with the wording of the letter that will be merged with the data fields.

The template will need to be saved to a location accessible to you system before inputting the file path and name.docx here.

Create

This field refers to the completed file that the merge action will output.

The file can be stored in an accessible shared drive, in which case enter the complete file path, name and type. Set the Document Store option to No when saving in a shared folder

The file can alternatively be sent straight to the system Document Store, in which case only the filename and type need be input here and the following Document Store option set to Yes

Input file type .pdf to create a pdf file or .doc to create a word file.

Ensure each merge action creates a unique filename by using system fields, for example suspension-confirmed-<EMP_ID>-<SEQ_ID>.doc

Print

When checked will send the created file directly to the system printer.

Document Store

Determines if the created file will be held in the Document Store

Edit

Following completion of all field settings press the Edit button.

Word will open the template document identified in the Template field.

Select the Mailings option from the Word toolbar to access the merge settings.

Select Use an existing list from the Select Recipients dropdown options

Input or Navigate to the file path and name.csv setup in the Data Source field of the Document tab and Select this as you Recipients List

The required data source fields now appear in the Insert Merge Fields dropdown.

Place the fields as required in you template

Save and close the document when your document is completed. Word will save the template back to the file path and name set in the Template field, now the template will retain the fields inserted.

Click OK to acknowledge that the csv source file will be discarded.

The Template now has the required fields from the Data Source embeded.

Click Save to retain the Action

Relocate the updated Template to the Document Store

As the Document merge Action can be performed at any time it is imporatant to ensure the updated template is accessible to the System when no one is logged onto the System. This is achieved by relocating the template to the System Document Store.

To save the document template to the Document Store:

  • Navigate to; System Setup > Housekeeping > Company Documents
  • Select New when the Document Store window opens
  • Navigate to the location of the Merge Template
  • Select the required Template file
  • Select the Open button to place a copy of the file in the Document Store

Save Templates in the Doc Store

Reconfigure the Template and Data Source fields

The Document Action must now be reconfigure to collect the template file from the Document Store and move the Data source out of the C:temp folder.

Return to the Document Tab in the Merge Action and revise the Template Field to point to the Template in the Document Store, replacing the original file path with <DOC_STORE> followed by the Document template filename. Remove the C:\temp\ from the Data Source to leave the Data Source filename and type: .csv only. Finally resave the Action.

When a Workflow Merge is triggered the resulting file can be attached to an Email for distribution to selected recipients. Place the exact Create field entry in the related Email Attachment field. For example: <KNOWNAS>_<SEQ_ID>_Contract.docx

Finally resave the Action.