Simple type data-merge

In Word API, a template with no repeating items in the data-merge field in one file is defined as the simple type.
This section describes the Word API data-merge feature of the simple type.

Merging data

You can use CSV and JSON format files for the simple type merging data.

CSV file

The simple type requires single CSV file that specifies the data-merge field name for the field name and the data for the merging data.

Simple CsvData Image

JSON file

The simple type requires a single JSON file consisting of a data-merge field name for the key and an array of objects specified the merging data to that value.

Simple JsonData Image

Example of simple type data-merge

An example is shown below.

Simple data merge exec example Image

Options

Output format

Following two formats can be output with an option of the data-merge result.

Output single file (default)

This is the default setting of Word API. Single file is output regardless of the number of records of data as same as Microsoft Word mail merge.
The option "Single" for each interface corresponds to it.
When this option is specified, the last data of the merging data is merged into the data-merge fields in the header and footer areas.

Output single file for each record

Single file is output for each record of data.
(Example): If you execute a three-record data-merge, three files will be output.
The option "PerData" for each interface corresponds to it.
When outputting a file for each record, the output file name and the additional position of the output file name text will be enabled.

Simple OutputMode Image

Sample files

[Install directory]/samples/templates/Simple_type_template.zip contains the simple type data-merge template and the sample file of the data.